Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: lsearch for perl?

by ikegami (Patriarch)
on Dec 05, 2005 at 15:45 UTC ( [id://514158]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $found = 0;
    @list = grep { $item ne $_ || $found++ } @list;
    
  2. or download this
    my ($index) = grep { $item eq $list[$_] } 0..$#list;
    splice(@list, $index, 1) if defined $index;
    
  3. or download this
    use List::Util qw( first );
    my $index = first { $item eq $list[$_] } 0..$#list;
    splice(@list, $index, 1) if defined $index;
    
  4. or download this
    use strict;
    use warnings;
    ...
    print("\n\n");
    
    print("The XS versions of List::Util and List::MoreUtils were used.\n"
    +);
    
  5. or download this
    Verify:
    
    ...
    
    
    The XS versions of List::Util and List::MoreUtils were used.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://514158]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-03-29 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found