in reply to Re: Inserting into an array while stepping through it
in thread Inserting into an array while stepping through it
Well, map() is a good alternate solution (though it wouldn't be doing the modification in place exactly.) But, you didn't show how to use it in the way he wants to...
and yes, that'll work when my_sub() returns a list too.@list = map { $_ eq 'condition' ? my_sub( $_ ) : $_ } @list;
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Inserting into an array while stepping through it
by meredith (Friar) on Jun 13, 2003 at 02:52 UTC |