Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > printing out the current URL for current ASP page in Perl

Reply
Thread Tools

printing out the current URL for current ASP page in Perl

 
 
Jack
Guest
Posts: n/a
 
      12-22-2008
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
 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      12-22-2008
Jack <> wrote:
>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
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      12-22-2008
Jack wrote:
> 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;

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
Tad J McClellan
Guest
Posts: n/a
 
      12-22-2008
Jürgen Exner <> wrote:
> Jack <> wrote:
>>Hi I am using ASP and Perl and printing the hash %ENV does nothing,

>
> 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.)


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:50 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:28 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-18-2007 10:11 AM
How to update the current web page? (delete current web page + rewrite the page) laryten@yahoo.com Javascript 3 10-12-2006 07:33 PM
Printing current page and another page mvr ASP General 1 02-09-2004 09:37 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57