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

This code from a perl cgi script
open(FH,"../top.html") || die "couldn't open file $!\n"; my @html=<FH>; close(FH); print @html;

is getting this error:
Software error: couldn't open file No such file or directory
I have tried targetting it in different directories, using whole path (home/mysite/www/)and clipped path. Tried chmoding it 744, 777 to no avail. Made sure it had correct content-type header tag.
Any advice on what do?
TIA
jg

Replies are listed 'Best First'.
Re: What to do when files is not found?
by blakem (Monsignor) on Sep 08, 2001 at 05:14 UTC
    Your "whole path" needs a leading slash, ala
    /home/mysite/www/top.html

    -Blake

      Thank you sir, that did it!
Re: What to do when files is not found?
by Chmrr (Vicar) on Sep 08, 2001 at 05:18 UTC

    It's possible that you're having the same problem as this one here. The solution turned out to be that the server was running in a chrooted environment. That's all that pops to mind that you've not tried yet.

     
    perl -e 'print "I love $^X$\"$]!$/"#$&V"+@( NO CARRIER'