Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: comparing array elements

by Itatsumaki (Friar)
on Nov 21, 2003 at 10:07 UTC ( #308840=note: print w/replies, xml ) Need Help??


in reply to Re: Re: comparing array elements
in thread comparing array elements

Why do you need two for-loops? Wouldn't one work?

my @array1 = ('test', 'text', 'next'); my @array2 = ('text', 'test', 'next'); for (my $i=0; $i < scalar(@array1); $i++) { if ($array1[$i] eq $array2[$i]) { print "$array1[$i] matches\n"; } }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2020-06-01 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?