Re: dropping () with qw()
> "Paul" == Paul Makepeace <[EMAIL PROTECTED]> writes: Paul> Is this new to 5.6 or have I just been ignorant this whole time? new to 5.6, where they made qw() a compile-time syntax instead of a runtime semantic. Meaning that: $a = qw(a b c); now puts "c" in $a, not 3 (with a warning about split to @_ deprecated). -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
dropping () with qw()
I thought for(each)? always took parens in the non-modifier forms but apparently you can drop them with qw(), tantrix:~$ perl -le 'for my $i qw(hello world) { print $i }' hello world tantrix:~$ perl -le '@a = qw(hello world); for my $i @a { print $i }' Array found where operator expected at -e line 1, at end of line (Missing operator before ?) syntax error at -e line 1, near "$i @a " Execution of -e aborted due to compilation errors. tantrix:~$ Is this new to 5.6 or have I just been ignorant this whole time? Paul (doesn't pay as much attn to perldelta as perhaps he should, possibly because of its enormous length) -- Paul Makepeace ... http://paulm.com/ "What is a thousand times nothing much? A painful accident involving two watermelons and a banana." -- http://paulm.com/toys/surrealism/