in reply to grep surprise
$type morgon2.pl use strict; use warnings; use List::MoreUtils 'indexes'; my @array=(1,2); my $i1 = indexes { $array[$_] == 1 } (0..$#array); my $i2 = indexes { $array[$_] == 2 } (0..$#array); my $i3 = indexes { $array[$_] == 3 } (0..$#array); print "<$i1> <$i2> <$i3>\n"; $perl morgon2.pl Use of uninitialized value $i3 in concatenation (.) or string at morgo +n2.pl line 10. <0> <1> <>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: grep surprise
by Athanasius (Archbishop) on Nov 12, 2018 at 13:21 UTC | |
by LanX (Saint) on Nov 12, 2018 at 16:04 UTC |