1,105,644 Community Members

CGI.pm obtaining script URL

Member Avatar
Newbie Poster
12 posts since Jan 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]

Hi All,

I'm a bit of a noobie to Perl, & am working on porting a Perl based web app from an old Sun box to a virtually hosted Windows box. The Windows box is (as far as I know) 2008R1 & running IIS 7.0, the version of Perl is 5.16.2.

The particular question I have is regarding the CGI.pm & obtaining the script's URL for the submit function. In the script I have created a form & cgi object with a reset & submit buttons using the submit & reset functions for CGI.pm. My understanding is that those functions should pass any user selected criteria from the form to the script for processing (or reset) once clicked upon:

print "<td align=center>".$query->submit."&nbsp".$query->defaults('Reset')."</td>";

However, I notice when I click on either button instead of "redirecting" to the appropriate url (http://xxx-dev.web.test.com/bin/myScriptHere.pl) I get sent to the following: http://xxx-dev.web.test.com:PortNumber.

Doing a bit of research on the cgi module I've found that I can "change" my path using -absolute, -relative, etc..., however, when I run the following test code to verify that the URL has changed appropriately, I get either NO URL at all or no changes in it:

my $query = new CGI();
my $testUrl = $query->url; #add whatever options [-absolute=>1, -relative=>1, etc...] here.
print ("The CGI Object's URL is = $testUrl");

I have been able to effectively use self_url, but this still formats the URL with the port number just before the bin directory, which I need to be able to remove.

I'm hoping someone can provide me some suggestions/directions; & I appreciate any help!


Member Avatar
Newbie Poster
22 posts since Sep 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]

why perl for this? enterprise bias?

This article has been dead for over three months: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: