in reply to Re: How to populate an Array
in thread How to populate an Array
BTW a cheeky one liner equivelent of your code
or a grep version$_ eq 'something' && push @y,$_ while <R>;
Although an added chomp might be a good idea..my @y=grep {$_ eq 'something'}<R>
Update
Spoo. I didnt notice bakus comment to the same effect.
One thing to remember though about the grep form is that it loads the whole thing into memory first, whereas the while form does not.
:-)
Yves / DeMerphq
--
This space for rent.
|
|---|