Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Default variable within loops

by muba (Priest)
on Jun 21, 2012 at 02:41 UTC ( #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; }


Comment on Re: Default variable within loops
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2014-09-16 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (9 votes), past polls