Template:Code:Valid
Jump to navigation
Jump to search
Usage
[edit source]This template is used to display a code that is at least syntactically valid.
Examples
[edit source]The following call
{{Code:Valid|The code <syntaxhighlight lang="perl"> my @array = qw(one two three); print "Array contains " . @array . " element" . ((@array == 1) ? "" : "s") . "\n"; </syntaxhighlight>| returns the following:| Array contains 3 elements }}
displays a perl code that is valid:
![](http://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Crystal_Clear_action_apply.png/20px-Crystal_Clear_action_apply.png)
my @array = qw(one two three);
print "Array contains " . @array . " element" . ((@array == 1) ? "" : "s") . "\n";
returns the following:
Array contains 3 elements