Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^5: Multiple foreach loops in single statement

by Anonymous Monk
on Oct 24, 2012 at 13:30 UTC ( #1000637=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Multiple foreach loops in single statement
in thread Multiple foreach loops in single statement

No , split doesn't work with lists, it forces scalar context on EXPR, so qx returns a STRING, not a list
$ perl -wle " print for split //, @ARGV " asdf 1 $ perl -wle " print for split //, @ARGV " a s d f 4 $ perl -wle " print for split //, $ARGV[0] " asdf a s d f

See Tutorials: Context in Perl: Context tutorial, "List" Is a Four-Letter Word, Easy Reference for Contexts

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2016-07-31 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (269 votes). Check out past polls.