in reply to Re: How to populate an Array
in thread How to populate an Array

Hi Sparky, a quick thought but there are a variety of color schemes in use here at the monastery. Coloring your text based on the color scheme that you use will most likely render it unpleasant to read for those of us who use a different one.

BTW a cheeky one liner equivelent of your code

$_ eq 'something' && push @y,$_ while <R>;
or a grep version
my @y=grep {$_ eq 'something'}<R>
Although an added chomp might be a good idea..

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.