[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] map {} instead of $i



BEFORE:

foreach (my $i=0; $i < scalar(@a); $i++) {
   $a[$i] = -1 unless (defined $a[$i]);
}


AFTER:

@a = map { defined $_ ? $_ : -1 } @a;


Your thoughts?

j