Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 musing on the Monastery: (6)
As of 2014-11-23 01:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (127 votes), past polls