in reply to Get Position of Element in an array
Try this:
@input=('a','b','c','d'); my $char='b'; print "$char is at position(s): ", join(", ", grep { $char eq $input[$_] } 0..$#input), "\n";
Note: Untested, you keep all the bits if it breaks, etc...
...roboticus
|
|---|