Hello All,
I have a basic question, I am new to perl, and I would like to try
and get a basic question answered, if possible. I have a file with
about 63 lines in it, I am running it through a basic perl program
that reads every line and prints it to the screen. I am trying to
get the output of each line into an @array, but all I am getting is
the last line in the file. Any help would be great.
Script .... Like I said it is basic.
__begin__
#!/usr/bin/perl
open(FILE, "file1.txt") || die "Can not open file. $! \n";
while ($line = <FILE>) {
if ($line =~ /:58/) {
#print $line; ## For Debugging Only
foreach ($line) {
@lines = $line;
}
}
}
print "@lines";
__end__
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>