Re: Modifying Array inside While statement



ced@xxxxxxxxxxxxxxxxxxxxx wrote:
> Andy wrote:
>>I have a perl script that takes an array and processes the arguments
>>inside it.
>>
>>while (<@my_array>) {
>> print "$_";
>> if (/new/i) {
>> @new_array = shift @my_array;
>> }
>>}
>>
>>....
>
> @my_array = map { /new/i ? () : $_ } @my_array;
>
> hth,

How would that help?


John
--
use Perl;
program
fulfillment
.



Relevant Pages