Help for this page

Select Code to Download


  1. or download this
        use List::Util 'first';
    
    ...
        # Simple enough to write inline:
    
        my $idx = first { $ary[$_] eq $target } 0 .. $#ary;