in reply to Re: Symbolic reference problem
in thread Symbolic reference problem
You are trying to read from a file name.No, I don't think so. This looks to me like the file globbing operator (same as glob). And this should work - once the syntax error after for is fixed. So rewriting a little bit:
# added braces and changed variable name for my $filename (</home/www/*/logs/weekly>) { substr($filename,-7)=" "; print $filename; }
while(<>) # reads from STDINand again no, this reads from the magic filehandle ARGV - which results in a read from STDIN when @ARGV is empty, otherwise it interprets the arguments in @ARGV as filenames and reads from them.
and you are right that <> is the best solution if you are trying to read from multiple fileswhile (<STDIN>) { # this reads from STDIN ... }
-- Hofmator
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Symbolic reference problem
by mirod (Canon) on Aug 20, 2001 at 15:17 UTC |