in reply to Re: Problem printing contents of file
in thread Problem printing contents of file

you said webservers set a diffrent current directory when they run the script.. probably this could be the reason. how am i to know which current directly are they using?
  • Comment on Re^2: Problem printing contents of file

Replies are listed 'Best First'.
Re^3: Problem printing contents of file
by syphilis (Archbishop) on Jun 18, 2008 at 06:50 UTC
    how am i to know which current directly are they using?

    Your script can make use of the Cwd module for that. (But, as stated elsewhere, the best approach is to use a full path to frame.txt instead of the relative path that you have been using. When you use a full path it doesn't matter where the current working directory is.)

    Cheers,
    Rob
      its giving me a error 500 when i put the whole path. whats the syntax for putting the full path while opening a file to read?

        Error 500 means that you have an error in your script. Look in the webserver error log to find what the error is. Or run your script from the command line to see Perl output the error message.

        What messages appeared in the error log?

        500 is an "internal server error" which should be documented in the error log.

        While developping you could use

        use CGI::Carp qw(fatalsToBrowser);

        to see fatal error messages (e.g. die messages) in the resulting error page...

Re^3: Problem printing contents of file
by Corion (Patriarch) on Jun 18, 2008 at 06:53 UTC

    Use the getcwd function from Cwd, or, even better, use absolute path names.