Help for this page

Select Code to Download


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