using 'my' within the while loop will make it lose it's value once the loop
exits and it will be reset every time you read in a new line
declare 'my @list' above the loop, and you'll not have that problem.
for readabillity, use:
if(/(\S+/){ push @list, $1 }
altho that's a bit superfluous i think, as i pointed out in my example
earlier
read up on scoping on MJD's site:
http://perl.plover.com/FAQs/Namespaces.html
Jos
> Here's what I have now:
> while(<FP>) {
> push (my @list, $1)
> if /(\S+)/;
> }
> foreach my $h(my @list) {
> print "$h";
> }
>
> I need to be able to access each individual host in the "FP" file pointer.
> This doesn't print anything to the screen.
>
> Really, thank you!
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]