Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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


Comment on Re^5: Multiple foreach loops in single statement
Download Code

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 romping around the Monastery: (10)
As of 2015-07-02 13:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (37 votes), past polls