Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl Tutorial code uses "qw" but has an error when run

by hippo (Bishop)
on May 02, 2018 at 14:50 UTC ( [id://1213945]=note: print w/replies, xml ) Need Help??


in reply to Perl Tutorial code uses "qw" but has an error when run

Your error is not in the use of qw// but in the use of for. The list over which for iterates must be in brackets. See:

$ perl -E 'for my $d qw( 2006-10-21 15.01.2007 10/31/2005 ) { say $d; +}' syntax error at -e line 1, near "$d qw( 2006-10-21 15.01.2007 10/31/20 +05 )" Execution of -e aborted due to compilation errors. $ perl -E 'for my $d (qw( 2006-10-21 15.01.2007 10/31/2005 )) { say $d +; }' 2006-10-21 15.01.2007 10/31/2005

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1213945]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-24 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found