in reply to Re^2: array index
in thread array index
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @list = qw{one two three four one}; my %lookup; for my $i (0..$#list){ push @{$lookup{$list[$i]}}, $i; } print "@{$lookup{one}}\n"; #print Dumper \%lookup;
|
|---|