chad kellerman said:
> Hello everyone,
> I am starting to work on a script that is going to process a few
> files in some users directories. I thought I would do some checking on
> the file to make sure they are there and to make sure they are really
> files. I thought it was going to be pretty straight forward, until I
> ran it for the first time. Sometimes the script sees the file for one
> user but not the next ( that I know is there)?
> I must be misunderstanding something small, but I can't figure it
> out.
> Can anyone offer any suggestions?
You are using glob in a scalar context. This is not what you want.
perldoc -f glob
> foreach my $user(@users)
> {
> print "Starting $user...\n";
> #print glob ("/home/$user/*-logs/old/200312/access-log.31-*.gz")."\n";
> $user = trim($user);
> my $decfile = glob
my ($decfile) = glob
> ("/home/$user/*-logs/old/200312/access-log.31-*.gz");
Finding a use for the current behaviour is left as an exercise for the
reader.
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>