Perl: Difference between revisions
From Freephile Wiki
No edit summary |
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight" Tags: Mobile edit Mobile web edit |
||
(One intermediate revision by one other user not shown) | |||
Line 2: | Line 2: | ||
http://freephile.com/cms/content/three-virtues-good-programmer | http://freephile.com/cms/content/three-virtues-good-programmer | ||
< | <syntaxhighlight lang="perl"> | ||
@a=(Lbzjoftt, Inqbujfodf, | @a=(Lbzjoftt, Inqbujfodf, | ||
Hvcsjt); $b="Lbssz Wbmm"; | Hvcsjt); $b="Lbssz Wbmm"; | ||
Line 15: | Line 15: | ||
;}else{ print "$a[$i], "; | ;}else{ print "$a[$i], "; | ||
}}print "\n\t\t--$b\n\n"; | }}print "\n\t\t--$b\n\n"; | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang="perl"> | ||
#!/usr/bin/perl | #!/usr/bin/perl | ||
Line 35: | Line 35: | ||
} | } | ||
print "\n\t\t--$b\n\n"; | print "\n\t\t--$b\n\n"; | ||
</ | </syntaxhighlight> | ||
<blockquote> | <blockquote> | ||
Line 44: | Line 44: | ||
</pre> | </pre> | ||
</blockquote> | </blockquote> | ||
[[Category:Perl]] |
Latest revision as of 13:26, 24 February 2025
See story at http://freephile.com/cms/content/three-virtues-good-programmer
@a=(Lbzjoftt, Inqbujfodf,
Hvcsjt); $b="Lbssz Wbmm";
$b =~ y/b-z/a-z/ ; $c =
" Tif ". @a . " hsfbu wj"
."suvft pg b qsphsbnnfs"
. ":\n";$c =~ y/b-y/a-z/;
print "\n\n$c ";for($i=0;
$i<@a; $i++) { $a[$i] =~
y/b-y/a-z/; if($a[$i]eq$a
[-1]) {print "and $a[$i]."
;}else{ print "$a[$i], ";
}}print "\n\t\t--$b\n\n";
#!/usr/bin/perl
@a=(Lbzjoftt, Inqbujfodf, Hvcsjt);
$b="Lbssz Wbmm";
$b =~ y/b-z/a-z/ ;
$c = " Tif ". @a . " hsfbu wj" ."suvft pg b qsphsbnnfs". ":\n";
$c =~ y/b-y/a-z/;
print "\n\n$c ";
for($i=0; $i<@a; $i++) {
$a[$i] =~ y/b-y/a-z/;
if($a[$i]eq$a[-1]) {
print "and $a[$i].";
}else{
print "$a[$i], ";
}
}
print "\n\t\t--$b\n\n";
The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall