Hi, List !
> if(open(FILE1, "/Users/tor/Perl/test")) {
> $line = <FILE1>;
> print ("This is the contents of the file\n");
> while($line ne " ") {
Hey, you are looking for a line that doesnt contain a space. ;o)
> print ($line);
> $line = <FILE1>;
> }
> }
>
if(open(FILE1, "/Users/tor/Perl/test")) {
print ("This is the contents of the file\n");
while (<FILE>) {
print $_;
}
}
This should work. The $_ variable is automatically filled with the last line
read from the file.
while (<FILE1>) { #slurps the file line by line
@file = <FILE1> #slurps the whole file into that array
HTH
Jan
--
cat /dev/world | perl -e "while (<>) {(/(^.*? \?) 42 \!/) && (print $1)}"
errors->(c)
_
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]