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!
----- Original Message -----
From: "Jos I. Boumans" <[EMAIL PROTECTED]>
To: "Tyler Longren" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 1:29 PM
Subject: Re: looking at rows in text files
> it's essentially the same thing, only instead of handing the match to the
> print operator, we store it in @list
>
> like so:
>
> open(FP, "$tempfile"); # Open $tempfile for reading
> while(<FP>) { push @list, /(\S+)/ }
>
> $list[0] will hold the first match, $list[1] the 2nd and so forth
>
> hope this helps,
>
> Jos
>
> > Hi Jos,
> >
> > Perhaps you could advise me. How can I put the hosts pulled from
> $tempfile
> > into an array or variable?
> > open(FP, "$tempfile"); # Open $tempfile for reading
> > while(<FP>) {
> > print /(\S+)/;
> > print "\n";
> >
> > }
> >
> > Thank you,
> > Tyler
> >
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]