# Tye + Juerd in id=204874 sub slurp { local( *ARGV, $/ ); @ARGV = shift; <> }; # slurp a bunch of files @files = do { local(@ARGV, $/) = @filenames; <> }; #### # get the indexes of items in an array @foo{ @foo } = 0 .. $#foo; $foo{'abc'} # the index of 'abc' in @foo # dragonchild id=376694 sub unique { my %x; grep { !$x{$_}++ } @_ } # broquaint id=374287 sub in_list {return !!grep { $_ eq $_[0] } @_[ 1 .. $#_ ];} # ysth sub in_list {my $target=shift; return !!grep { $_ eq $target } @_} # demerphq sub find_first_index { my $target=shift; push @_,$target; my $i=0; $i++ while $_[$i] ne $target; return $i==$#_ ? undef : $i }