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
In reply to Re: Re: Symbolic reference problem
by Hofmator
in thread Symbolic reference problem
by wylie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |