Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Problems with sticky CGI params

by hoonz (Initiate)
on Oct 23, 2001 at 17:40 UTC ( #120783=note: print w/replies, xml ) Need Help??

in reply to Re: Problems with sticky CGI params
in thread Problems with sticky CGI params

Thanks Projekt21 and Hero. I tried the print Location version and it displays a 404 error (page not found)after calling the sub

The script creates HTML on the fly and does not use HTML templates. Does have to be installed on the server or can I have it in my CGI bin? If I do use it, do I have to re-code everything or can I just do parts?

Replies are listed 'Best First'.
Re: Re: Problems with sticky CGI params
by tachyon (Chancellor) on Oct 23, 2001 at 18:07 UTC is part of the standard perl distribution so should already be installed. You can install virtually any module locally but you should not need to. No major recoding is required. Just use what you want, is a huge module and few people use all its many features - at least in the one script. See Use CGI or die; and No excuses about not using




Re: Re: Problems with sticky CGI params
by sifukurt (Hermit) on Oct 23, 2001 at 18:15 UTC
    More than likely, is already installed on your system. If for some reason it isn't, yes, it would probably make life a little easier for it to be installed, but you can use a private copy, provided you use lib at the top of your script. For example:
    #!/usr/bin/perl use lib "/my/module/directory"; use CGI;

    Perl will then look in your specified directory for the module before looking through the the default directories in @INC.

    As far as re-coding if you use goes, the short answer is technically, no, you don't have to re-code everything. Others may disagree with me, but personally, I'd be inclined to just use for the parts in question for the time being. Once you get it working, dig into a bit further and see if there are ways to make your script better and more efficient by taking advantage of more of the features of

    That's my 8**(1/3) cents. Hope that helps.
Re: Re: Problems with sticky CGI params
by Hero Zzyzzx (Curate) on Oct 23, 2001 at 18:02 UTC

    I'm sure you're getting a 404 error because there's either something wrong with your header or your URL is wrong (most likely the latter, IMO). Your redirect header also needs to be the first thing printed from your script.

    To answer your other questions: If you're using perl, you can use CGI in most cases. The CGI perl module is part of all modern perl distributions. And in terms of using "parts" of CGI- yes, you can. Another lovely thing about perl is that it doesn't force you into one way of doing things. Why don't you try the code that Projekt21 suggested and see what shakes out?

    -Any sufficiently advanced technology is
    indistinguishable from doubletalk.

      I thought I replied but it seems to have vanished. I did indeed have the URL wrong. I will look into though because it seems to do things a lot easier than what I am used to. Thanks again for all your assistance.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2023-10-02 17:21 GMT
Find Nodes?
    Voting Booth?

    No recent polls found