Operating System - OpenVMS
1832641 Members
2752 Online
110043 Solutions
New Discussion

csws2.1 perl cgi redir problem with exit()

 
June Young
New Member

csws2.1 perl cgi redir problem with exit()

Hi,

I am using VMS V8.2, csws2.1 and csws_perl2.1.

Our own perl CGI scripts normally have if statements saying that if
this...do redirect to another URL and exit(), otherwise, continue to
display the form. These scripts used to work on CSWS1.3, now showing
"unexpect network read error, can't access start file...." on the
browser with csws2.1. I noticed that it is exit() that follows $query->redirect()
causes the trouble.


Test1.CGI (works):
use CGI;
$query =CGI->new();
print $query->redirect(-url=>"http://dymc.dymaxion.ca/cgi-bin/jy1.com");


TEST2.CGI (does not work).
use CGI;
$query =CGI->new();
print $query->redirect(-url=>"http://dymc.dymaxion.ca/cgi-bin/jy1.com");
exit();


I am using ModPerl::Registry for my perl CGIs. I understand that
exit() is actually ModPerl::Util::exit() which only exits the request
not the process, but I don't understand why it will affect my redirect to fail.

I do not want to change exit() to function return because the redir command can be wrapped in several level down function calls and we don't want to check a flag in each level which is quite messy.

Any help is appreciated.


June Young, Software Development bus: (902)422-1973 x144
Dymaxion Research Ltd., 5515 Cogswell St., fax: (902)421-1267
Halifax, Nova Scotia, B3J 1R2 Canada mailto: JYoung@dymaxion.ca
http://www.dymaxion.ca

2 REPLIES 2
Ian Miller.
Honored Contributor

Re: csws2.1 perl cgi redir problem with exit()

As no reply here then try the VAMP site
http://www.issinoho.com:8080/phpbb2/
____________________
Purely Personal Opinion
Carl Karcher
Advisor

Re: csws2.1 perl cgi redir problem with exit()

Yes, exit is supposed to get overriden. It works on linux with the identical version of mod_perl (1.999.211024). If you're looking for a rather ugly work around that avoids having to change exits to returns, see the attached sample script.

I've submitted this issue to HP under case 3215622699