#!/usr/local/bin/perl use strict; use warnings; # Working versions. warn $_ for qw/ p / ; for my $var qw/ p / { warn $var } for ( qw/ p / ) { warn $_ } # Fails at compile time. # This is commented just to have the program be compiled and get error via # eval. #for qw/ p / { warn $_ }; my $code = eval "for qw/ p / { warn $_ } " ; warn "code: $code error: $@"; __END__ Error message produced ... Missing $ on loop variable at -e line 1 (#1) ... diagnostics module adds ... (F) Apparently you've been programming in csh too much. Variables are always mentioned with the $ in Perl, unlike in the shells, where it can vary from one line to the next.