while(1) { print "input: "; my $in = <STDIN>; chomp($in); given($in) { when (/l/) { print "\nlegs"; } when (/h/) { print "\nhead"; } when (/b/) { print "\nbody"; } when (/s/) { print "\nspecial"; } } }
In reply to Quick syntax error in 13 lines of code by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |