Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

File::Spec->rel2abs hanging?

by skazat (Chaplain)
on Jan 10, 2005 at 00:14 UTC ( [id://420775]=perlquestion: print w/replies, xml ) Need Help??

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

Hello All,

I'm having some problem with the File::Spec module's rel2abs() method when working in a CGI environment, basically, when a call is made like this:

#!/usr/bin/perl use CGI::Carp "fatalsToBrowser"; use File::Spec; use CGI qw(:standard); print header(); print File::Spec->rel2abs(__FILE__);

via webbrowser - it'll just hang forever.

Via the command line, it'll come back with the correct answer right away.

Here's the ENV:

bash-2.05b$ perl -v This is perl, v5.8.2 built for i386-freebsd

and,

bash-2.05b$ uname -a FreeBSD web2.host.ie 4.9-STABLE FreeBSD 4.9-STABLE #0: Fri Feb 27 10:1 +1:56 GMT 2004 root@web2.host.ie:/usr/src/sys/compile/WEB i386

Is there something I'm missing that may lead me to more clues?

 

-justin simoni
skazat me

Replies are listed 'Best First'.
Re: File::Spec->rel2abs hanging?
by Corion (Patriarch) on Jan 10, 2005 at 08:25 UTC

    You are not using rel2abs in its 2 argument form. Always use rel2abs in its 2 argument form, because your "current directory" will not be what you think it is when you are running as a CGI.

Re: File::Spec->rel2abs hanging?
by sasikumar (Monk) on Jan 10, 2005 at 08:38 UTC
    Hi, Can u tell us what your are trying to acheive. This would help us in resolving the error.

    more over try to print __FILE__ on the web page and see is it perfect?

    Thanks
    SasiKumar

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://420775]
Approved by Courage
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found