http://qs1969.pair.com?node_id=88571

FouRPlaY has asked for the wisdom of the Perl Monks concerning the following question:

I have a file that looks like this:
992535783 6 6 7 19 992536692 9 6 9 24 992537600 8 8 7 23 992538508 7 10 6 23 992539415 5 15 8 28 992540322 8 14 8 30 992541229 7 15 10 32 992542137 7 13 10 30 992542984 6 16 8 30 992543891 8 12 6 26

Which is epoch time followed by user's logged into three different rooms, followed by the total. I use this code to read it in and display it in pretty html:
#!/usr/bin/perl -w use strict; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); my @headings = ('Time','MC3004','MC3005','MC3027'); my @rows = th(\@headings); open LABS, "/software/polaris-mfcf/data/local/w.stat" or die "Unable t +o open file: $!\n"; for (<LABS>) { my ($time,$num4,$num5,$num7) = split; $time = localtime($time); my $check = substr(localtime(time),4,6); push @rows, td([$time,$num4,$num5,$num7]) if $time =~ /$check/ +; } close LABS; print header; print start_html('Polaris Usage'); print table({-border=>undef}, caption(strong('Polaris Terminal Usage')), Tr(\@rows) ); print end_html;


When I run it gives a file not found error from the die command. But, the file does exist. I've tried running it from a different user's web space with a copy of the file and it works fine. When I run it from the command line, it runs fine. When I run it from the command line and pipe the output to a file, that file contains all the right/vaild html and output.

Does anyone know why, when I try to access the file from it's own directory it would be unable to find a file that exists?



FouRPlaY
Learning Perl or Going To die() Trying