in reply to Perl Warning Help

I'm not sure what that error means -- add use diagnostics for more details if it's a Perl error -- but I doubt the error is where you say it is since the word "Perl" does not appear in that snippet.

By the way, why do you use $x outside the foreach loop and as the variable for the foreach loop? The outer $x is not affected by the foreach, but it's very confusing (and therefore hard to read and to maintain).

my $x = '!'; foreach $x (qw( a b c )) { print("$x\n"); } print("$x\n");

outputs

a b c !