Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: calling a html file from a perl script

by HyperZonk (Friar)
on Jul 21, 2001 at 05:39 UTC ( [id://98606]=note: print w/replies, xml ) Need Help??


in reply to calling a html file from a perl script

Perhaps I am missing something in this quest, but it would seem far easier, if you are using CGI.pm (which you probably should be if you are working with CGI), to use redirect.
if (condition) { print redirect(-uri=>'http://www.mysite.com/xyz.html'); } else { print redirect(-uri=>'http://www.mysite.com/abc.html'); }

See the documentation for CGI.pm for more details.

Important note: the redirect must be the first thing printed to STDOUT for it to work.

You can use the object oriented version (assuming you have done $q = new CGI;):
if (condition) { print $q->redirect(-uri=>'http://www.mysite.com/xyz.html'); } else { print $q->redirect(-uri=>'http://www.mysite.com/abc.html'); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found