No, but you can use a list of references to hashes or arrays that contain multiple values:
my @AoH = ( { firstname => 'foo', lastname => 'bar' }, { firstname => 'baz', lastname => 'quux' } ); foreach my $href ( @AoH ) { # do something with $href->{firstname} and $href->{lastname} }
In reply to Re: can we pass two variable to foreach loop
by bobf
in thread can we pass two variable to foreach loop
by phemal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |