Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Quick syntax error in 13 lines of code
by toolic (Bishop) on Sep 30, 2011 at 14:15 UTC | |
|
Re: Quick syntax error in 13 lines of code
by GrandFather (Saint) on Oct 01, 2011 at 03:19 UTC |