Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Default variable within loops

by muba (Priest)
on Jun 21, 2012 at 02:41 UTC ( [id://977539]=note: print w/replies, xml ) Need Help??


in reply to Default variable within loops

use strict; use warnings; my @a = qw(foo bar baz); my @b = qw(foo bar biz); foreach my $temp (@a){ my @matches = grep {$temp eq $_} @b; print "Matches for $temp: ", join(", ", @matches), "\n" if @matche +s; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found