in reply to how to refer the index of an array to another array of the same length
I think you need a C-style for loop, to keep track of the array index. Something like this:
for my $i (0 .. $#cg) { my $g = $cg[$i]; if ($g eq $gl[$i]) { push @ind, $g; print N "$g\n"; print S "$csta[$i]\n"; } }
Is that what you’re looking for? If not, please specify sample input (the contents of the arrays) together with the output you expect.
Hope that helps,
Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to refer the index of an array to another array of the same length
by rocketperl (Sexton) on Aug 03, 2013 at 09:56 UTC | |
by CountZero (Bishop) on Aug 03, 2013 at 10:03 UTC | |
by rocketperl (Sexton) on Aug 03, 2013 at 10:20 UTC |
In Section
Seekers of Perl Wisdom