in reply to Re: Getting file size
in thread Getting file size

Thanks, I'm kinda new to this environment and the way they have it setup here in the office I don't have access to server logs (They use a NT box that kicks of a batch file to run the perl script, goes by so fast I can barely see the error messages.) This is a Perl script not a CGI file I dunno what difference that makes in this case.

But I tryed your code with a file that is in the same directory as the script I am running and it dies for some strange reason.

my $filename = "tools2.pl";
my $size = -s $filename;
unless ($size) { die "+++++***** error getting file size [$filename]: [$!] *****+++++";}

I appreciate all the help I get from this site, everybody replied so darn fast!

Replies are listed 'Best First'.
Re: Re: Re: Getting file size
by kabel (Chaplain) on Sep 25, 2002 at 08:01 UTC
    aha. and what is the error message you are getting?
    and be sure to change the last line to
    unless (defined $size) {...}
    , as aristotle correctly suggested.
    it is always a good idea to log important issue to a file which either is specified in the script itself or can be specified via command line. any fatal error is an important issue.