You have to turn on new features in Perl 5.10. Toolic indicated one way. Another way is to turn on all the 5.10 features so the usual strictures boilerplate extends to include use 5.010;:
use strict; use warnings; use 5.010; 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 Re: Quick syntax error in 13 lines of code
by GrandFather
in thread Quick syntax error in 13 lines of code
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |