in reply to cool way of manipulating array elements

foreach/for/while is uncool? Anyway, there's always the trusty goto (adjust regexp to taste):
my $i = 0; again: $array[$i] *= 2 unless $array[$i] =~ /[^0-9]/; goto again if ++$i <= $#array;
Or as a bare block:
my $i = 0; {$array[$i] *= 2 unless $array[$i] =~ /[^0-9]/; redo if ++$i <= $#array;}
But I prefer a for:
/[^0-9]/ or $_ *= 2 for @array;
Why would that not be cool enough?

Replies are listed 'Best First'.
Re^2: cool way of manipulating array elements
by jdrago999 (Pilgrim) on Sep 02, 2011 at 01:58 UTC
    /[^0-9]/ or $_ *= 2 for @array;

    Mind blown.