in reply to Quick syntax error in 13 lines of code

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";} } }
True laziness is hard work