Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 chilling in the Monastery: (5)
As of 2014-08-01 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls