Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: can we pass two variable to foreach loop

by Zaxo (Archbishop)
on Mar 28, 2007 at 05:57 UTC ( #606916=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for ([qw/Joe Blow/], [qw/John Doe/]) {
        my ($x, $y) = @$_;
        # do something
    }
    
  2. or download this
    for ('Joe Blow', 'John Doe') {
        my ($x, $y) = split;
        # and so on
    }
    
  3. or download this
    {
        my ($x, $y) = ($name, $lastname);
        # do something
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (17)
As of 2015-07-30 19:19 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 (273 votes), past polls