- or download this
#!/usr/bin/env perl
...
my $idx = first {$array[$_] == 4} reverse 0..$#array;
print "$idx\n";
- or download this
#!/usr/bin/env perl
...
my $idx = lastidx {$_ == 4} @array;
print "$idx\n";
- or download this
#!/usr/bin/env perl
...
}
print "$idx\n";