printing out the current URL for current ASP page in Perl

J

Jack

Hi I am using ASP and Perl and printing the hash %ENV does nothing, as
does $ENV{URLVARIABLES} (With URLVARIABLES being anything..

Any ideas would be great.

Thank you,

Jack
 
J

Jürgen Exner

Jack said:
Hi I am using ASP and Perl and printing the hash %ENV does nothing,

Well, there could be a few reasons:
- %ENV is empty. This is possible but highly unlikely unless you
deliberately emptied it.
- print() has a bug. While not completely impossible this is extremely
unlikely and would require quite some supporting evidence.
- you are looking at the wrong place, i.e. you are not looking where
print() is printing.

You might also be print()ing to a closed file handle, but in that case
you would get an error message "print() on closed filehandle" instead of
nothing.

jue
 
G

Gunnar Hjalmarsson

Jack said:
Subject: printing out the current URL for current ASP page in Perl

I am using ASP and Perl and printing the hash %ENV does nothing, as
does $ENV{URLVARIABLES} (With URLVARIABLES being anything..

I have no idea how you pick the environment in ASP. If it had been a
Perl CGI script you would have been able to say:

print "http://$ENV{HTTP_HOST}$ENV{REQUEST_URI}\n";

And to print the whole %ENV var:

print "$_ = $ENV{$_}\n" for keys %ENV;
 
T

Tad J McClellan

Jürgen Exner said:
Well, there could be a few reasons:

[ snip some reasons ]
You might also be print()ing to a closed file handle, but in that case
you would get an error message "print() on closed filehandle" instead of ^^^^^^^^^^^^^
nothing.


That is a _warning_ message, so you'd get nothing if warnings
were not enabled.

(But warnings should always be enabled when developing Perl code.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top