Redirect and pass variables
Redirect and pass variables
am 15.11.2005 02:40:10 von Ed Jay
I have a multi-file script (Not cgi). I read in variables from an
HTML-based form, add values for a few more variables using a form, and
then submit the new values plus the original values, in hidden form
fields, to the next Perl script.
If a couple of variables have zero value, I want to skip processing on the
'next' page and redirect to page2n. I'm using the following simple logic
and redirect in Page n's script:
Read in previous variables.
if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
/cgi-bin/pagen2.cgi', "\r\n\r\n";}
Problem is, the values for all previous variable do not pass to page2n.
How do I solve this issue?
--
Ed Jay (remove M to respond by email)
Re: Redirect and pass variables
am 15.11.2005 03:01:19 von Gunnar Hjalmarsson
Ed Jay wrote:
> I have a multi-file script (Not cgi).
???
> I read in variables from an
> HTML-based form, add values for a few more variables using a form, and
> then submit the new values plus the original values, in hidden form
> fields, to the next Perl script.
>
> If a couple of variables have zero value, I want to skip processing on the
> 'next' page and redirect to page2n. I'm using the following simple logic
> and redirect in Page n's script:
>
> Read in previous variables.
>
> if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
> /cgi-bin/pagen2.cgi', "\r\n\r\n";}
>
> Problem is, the values for all previous variable do not pass to page2n.
>
> How do I solve this issue?
perldoc HTTP::Request::Common
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Re: Redirect and pass variables
am 15.11.2005 03:06:13 von Matt Garrish
"Ed Jay" wrote in message
news:4mein1hrgppkcd63kqnehbort15tn7r1f1@4ax.com...
>I have a multi-file script (Not cgi). I read in variables from an
> HTML-based form, add values for a few more variables using a form, and
> then submit the new values plus the original values, in hidden form
> fields, to the next Perl script.
>
> If a couple of variables have zero value, I want to skip processing on the
> 'next' page and redirect to page2n. I'm using the following simple logic
> and redirect in Page n's script:
>
> Read in previous variables.
>
> if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
> /cgi-bin/pagen2.cgi', "\r\n\r\n";}
>
Please don't retype code. It makes it difficult to know what you're real
problem is (var2 should be $var2 above, one would assume). Also, it's
strange that they aren't cgi scripts, but they have cgi extensions and use
the gateway...
> Problem is, the values for all previous variable do not pass to page2n.
Because you didn't pass them. All you did was redirect:
print "Location: /cgi-bin/pagen2.cgi?var1=$var1&var2=$var2\n\n";
Of course, you may want to consider uri escaping the variables before
including them in the string, but that's left as an exercise for you...
Matt
Re: Redirect and pass variables
am 15.11.2005 03:33:09 von Ed Jay
"Matt Garrish" wrote:
>
>"Ed Jay" wrote in message
>news:4mein1hrgppkcd63kqnehbort15tn7r1f1@4ax.com...
>>I have a multi-file script (Not cgi). I read in variables from an
>> HTML-based form, add values for a few more variables using a form, and
>> then submit the new values plus the original values, in hidden form
>> fields, to the next Perl script.
>>
>> If a couple of variables have zero value, I want to skip processing on the
>> 'next' page and redirect to page2n. I'm using the following simple logic
>> and redirect in Page n's script:
>>
>> Read in previous variables.
>>
>> if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
>> /cgi-bin/pagen2.cgi', "\r\n\r\n";}
>>
>
>Please don't retype code. It makes it difficult to know what you're real
>problem is (var2 should be $var2 above, one would assume).
Sorry $var2.
>Also, it's
>strange that they aren't cgi scripts, but they have cgi extensions and use
>the gateway...
The scripts are written in Perl, but I don't use the CGI module.
>
>> Problem is, the values for all previous variable do not pass to page2n.
>
>Because you didn't pass them. All you did was redirect:
>
>print "Location: /cgi-bin/pagen2.cgi?var1=$var1&var2=$var2\n\n";
>
>Of course, you may want to consider uri escaping the variables before
>including them in the string, but that's left as an exercise for you...
>
Thanks, Matt.
--
Ed Jay (remove M to respond by email)
Re: Redirect and pass variables
am 15.11.2005 06:44:00 von Ed Jay
"Matt Garrish" wrote:
>
>"Ed Jay" wrote in message
>news:4mein1hrgppkcd63kqnehbort15tn7r1f1@4ax.com...
>>I have a multi-file script (Not cgi). I read in variables from an
>> HTML-based form, add values for a few more variables using a form, and
>> then submit the new values plus the original values, in hidden form
>> fields, to the next Perl script.
>>
>> If a couple of variables have zero value, I want to skip processing on the
>> 'next' page and redirect to page2n. I'm using the following simple logic
>> and redirect in Page n's script:
>>
>> Read in previous variables.
>>
>> if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
>> /cgi-bin/pagen2.cgi', "\r\n\r\n";}
>>
>
>Please don't retype code. It makes it difficult to know what you're real
>problem is (var2 should be $var2 above, one would assume). Also, it's
>strange that they aren't cgi scripts, but they have cgi extensions and use
>the gateway...
>
>> Problem is, the values for all previous variable do not pass to page2n.
>
>Because you didn't pass them. All you did was redirect:
>
>print "Location: /cgi-bin/pagen2.cgi?var1=$var1&var2=$var2\n\n";
>
>Of course, you may want to consider uri escaping the variables before
>including them in the string, but that's left as an exercise for you...
>
Pardon me for retyping the code, but I have no idea how else to say that:
print "Location:...
/url.cgi?\$patient_id=\$patient_id&\$exam_date=\$exam_date&\ $refer_clinic=\$refer_clinic\n\n";
isn't working.
After it redirects I see the url, inclusive of the ? and everything after
it in the browser's address bar, but the variables don't get passed.
--
Ed Jay (remove M to respond by email)
Re: Redirect and pass variables
am 15.11.2005 10:25:19 von Ed Jay
Ed Jay wrote:
>"Matt Garrish" wrote:
>
>>
>>"Ed Jay" wrote in message
>>news:4mein1hrgppkcd63kqnehbort15tn7r1f1@4ax.com...
>>>I have a multi-file script (Not cgi). I read in variables from an
>>> HTML-based form, add values for a few more variables using a form, and
>>> then submit the new values plus the original values, in hidden form
>>> fields, to the next Perl script.
>>>
>>> If a couple of variables have zero value, I want to skip processing on the
>>> 'next' page and redirect to page2n. I'm using the following simple logic
>>> and redirect in Page n's script:
>>>
>>> Read in previous variables.
>>>
>>> if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
>>> /cgi-bin/pagen2.cgi', "\r\n\r\n";}
>>>
>>
>>Please don't retype code. It makes it difficult to know what you're real
>>problem is (var2 should be $var2 above, one would assume). Also, it's
>>strange that they aren't cgi scripts, but they have cgi extensions and use
>>the gateway...
>>
>>> Problem is, the values for all previous variable do not pass to page2n.
>>
>>Because you didn't pass them. All you did was redirect:
>>
>>print "Location: /cgi-bin/pagen2.cgi?var1=$var1&var2=$var2\n\n";
>>
>>Of course, you may want to consider uri escaping the variables before
>>including them in the string, but that's left as an exercise for you...
>>
>Pardon me for retyping the code, but I have no idea how else to say that:
>
>print "Location:...
>/url.cgi?\$patient_id=\$patient_id&\$exam_date=\$exam_date& \$refer_clinic=\$refer_clinic\n\n";
>
>isn't working.
>
>After it redirects I see the url, inclusive of the ? and everything after
>it in the browser's address bar, but the variables don't get passed.
To follow up...
I've renamed my scripts with the extension 'pl.'
My redirect precedes the document type header.
I've tried:
..pl?var1=var1
..pl?var1=$var1
..pl?var1=\$var1
..pl?$var1=$var1
..pl?\$var1=\$var1
..pl?var1=$formdata{'$var1'}
..pl?var1=\$formdata{'$var1'}
all to no avail.
--
Ed Jay (remove M to respond by email)
Re: Redirect and pass variables
am 15.11.2005 14:02:13 von Matt Garrish
"Ed Jay" wrote in message
news:5q9jn1lng6u86patiu4glq0n4urj53e4lg@4ax.com...
> Ed Jay wrote:
>
>>"Matt Garrish" wrote:
>>
>>>
>>>"Ed Jay" wrote in message
>>>news:4mein1hrgppkcd63kqnehbort15tn7r1f1@4ax.com...
>>>>I have a multi-file script (Not cgi). I read in variables from an
>>>> HTML-based form, add values for a few more variables using a form, and
>>>> then submit the new values plus the original values, in hidden form
>>>> fields, to the next Perl script.
>>>>
>>>> If a couple of variables have zero value, I want to skip processing on
>>>> the
>>>> 'next' page and redirect to page2n. I'm using the following simple
>>>> logic
>>>> and redirect in Page n's script:
>>>>
>>>> Read in previous variables.
>>>>
>>>> if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
>>>> /cgi-bin/pagen2.cgi', "\r\n\r\n";}
>>>>
>>>
>>>Please don't retype code. It makes it difficult to know what you're real
>>>problem is (var2 should be $var2 above, one would assume). Also, it's
>>>strange that they aren't cgi scripts, but they have cgi extensions and
>>>use
>>>the gateway...
>>>
>>>> Problem is, the values for all previous variable do not pass to page2n.
>>>
>>>Because you didn't pass them. All you did was redirect:
>>>
>>>print "Location: /cgi-bin/pagen2.cgi?var1=$var1&var2=$var2\n\n";
>>>
>>>Of course, you may want to consider uri escaping the variables before
>>>including them in the string, but that's left as an exercise for you...
>>>
>>Pardon me for retyping the code, but I have no idea how else to say that:
>>
>>print "Location:...
>>/url.cgi?\$patient_id=\$patient_id&\$exam_date=\$exam_date &\$refer_clinic=\$refer_clinic\n\n";
>>
>>isn't working.
>>
>>After it redirects I see the url, inclusive of the ? and everything after
>>it in the browser's address bar, but the variables don't get passed.
>
> To follow up...
>
> I've renamed my scripts with the extension 'pl.'
> My redirect precedes the document type header.
> I've tried:
>
> .pl?var1=var1
> .pl?var1=$var1
> .pl?var1=\$var1
> .pl?$var1=$var1
> .pl?\$var1=\$var1
> .pl?var1=$formdata{'$var1'}
> .pl?var1=\$formdata{'$var1'}
>
> all to no avail.
Which begs the question, if you're not using CGI.pm, how are you accessing
the variables? If you're using code that only processes post requests, then
it's not surprising that nothing turns up in your second script. Without
seeing the code you're using to get the variables, however, there's no way
of helping you at this point.
Matt
Re: Redirect and pass variables
am 15.11.2005 16:09:47 von Ed Jay
"Matt Garrish" wrote:
>
>"Ed Jay" wrote in message
>news:5q9jn1lng6u86patiu4glq0n4urj53e4lg@4ax.com...
>> Ed Jay wrote:
>>
>>>"Matt Garrish" wrote:
>>>
>>>>
>>>>"Ed Jay" wrote in message
>>>>news:4mein1hrgppkcd63kqnehbort15tn7r1f1@4ax.com...
>>>>>I have a multi-file script (Not cgi). I read in variables from an
>>>>> HTML-based form, add values for a few more variables using a form, and
>>>>> then submit the new values plus the original values, in hidden form
>>>>> fields, to the next Perl script.
>>>>>
>>>>> If a couple of variables have zero value, I want to skip processing on
>>>>> the
>>>>> 'next' page and redirect to page2n. I'm using the following simple
>>>>> logic
>>>>> and redirect in Page n's script:
>>>>>
>>>>> Read in previous variables.
>>>>>
>>>>> if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
>>>>> /cgi-bin/pagen2.cgi', "\r\n\r\n";}
>>>>>
>>>>
>>>>Please don't retype code. It makes it difficult to know what you're real
>>>>problem is (var2 should be $var2 above, one would assume). Also, it's
>>>>strange that they aren't cgi scripts, but they have cgi extensions and
>>>>use
>>>>the gateway...
>>>>
>>>>> Problem is, the values for all previous variable do not pass to page2n.
>>>>
>>>>Because you didn't pass them. All you did was redirect:
>>>>
>>>>print "Location: /cgi-bin/pagen2.cgi?var1=$var1&var2=$var2\n\n";
>>>>
>>>>Of course, you may want to consider uri escaping the variables before
>>>>including them in the string, but that's left as an exercise for you...
>>>>
>>>Pardon me for retyping the code, but I have no idea how else to say that:
>>>
>>>print "Location:...
>>>/url.cgi?\$patient_id=\$patient_id&\$exam_date=\$exam_dat e&\$refer_clinic=\$refer_clinic\n\n";
>>>
>>>isn't working.
>>>
>>>After it redirects I see the url, inclusive of the ? and everything after
>>>it in the browser's address bar, but the variables don't get passed.
>>
>> To follow up...
>>
>> I've renamed my scripts with the extension 'pl.'
>> My redirect precedes the document type header.
>> I've tried:
>>
>> .pl?var1=var1
>> .pl?var1=$var1
>> .pl?var1=\$var1
>> .pl?$var1=$var1
>> .pl?\$var1=\$var1
>> .pl?var1=$formdata{'$var1'}
>> .pl?var1=\$formdata{'$var1'}
>>
>> all to no avail.
>
>Which begs the question, if you're not using CGI.pm, how are you accessing
>the variables? If you're using code that only processes post requests, then
>it's not surprising that nothing turns up in your second script. Without
>seeing the code you're using to get the variables, however, there's no way
>of helping you at this point.
>
Here is the code to access the variables, followed by three of the 60
variables I'm trying to pass:
$buffer = "";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$buffer);
foreach $pair (@pairs)
{
@a = split(/=/,$pair);
$name=$a[0];
$value=$a[1];
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/~!/ ~!/g;
$value =~ s/\+/ /g;
$value =~ s/\r//g;
push (@data,$name);
push (@data, $value);
}
%formdata=@data;
%formdata;
$var1 = $formdata{'var1'};
$var2 = $formdata{'var2'};
$var3 = $formdata{'var3'};
--
Ed Jay (remove M to respond by email)
Re: Redirect and pass variables
am 16.11.2005 00:47:35 von Matt Garrish
"Ed Jay" wrote in message
news:m3ujn1t48j4uh2c0cu61ehfliclut0p8e1@4ax.com...
> "Matt Garrish" wrote:
>
>>
>>"Ed Jay" wrote in message
>>news:5q9jn1lng6u86patiu4glq0n4urj53e4lg@4ax.com...
>>> Ed Jay wrote:
>>>
>>>>"Matt Garrish" wrote:
>>>>
>>>>>
>>>>>"Ed Jay" wrote in message
>>>>>news:4mein1hrgppkcd63kqnehbort15tn7r1f1@4ax.com...
>>>>>>I have a multi-file script (Not cgi). I read in variables from an
>>>>>> HTML-based form, add values for a few more variables using a form,
>>>>>> and
>>>>>> then submit the new values plus the original values, in hidden form
>>>>>> fields, to the next Perl script.
>>>>>>
>>>>>> If a couple of variables have zero value, I want to skip processing
>>>>>> on
>>>>>> the
>>>>>> 'next' page and redirect to page2n. I'm using the following simple
>>>>>> logic
>>>>>> and redirect in Page n's script:
>>>>>>
>>>>>> Read in previous variables.
>>>>>>
>>>>>> if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
>>>>>> /cgi-bin/pagen2.cgi', "\r\n\r\n";}
>>>>>>
>>>>>
>>>>>Please don't retype code. It makes it difficult to know what you're
>>>>>real
>>>>>problem is (var2 should be $var2 above, one would assume). Also, it's
>>>>>strange that they aren't cgi scripts, but they have cgi extensions and
>>>>>use
>>>>>the gateway...
>>>>>
>>>>>> Problem is, the values for all previous variable do not pass to
>>>>>> page2n.
>>>>>
>>>>>Because you didn't pass them. All you did was redirect:
>>>>>
>>>>>print "Location: /cgi-bin/pagen2.cgi?var1=$var1&var2=$var2\n\n";
>>>>>
>>>>>Of course, you may want to consider uri escaping the variables before
>>>>>including them in the string, but that's left as an exercise for you...
>>>>>
>>>>Pardon me for retyping the code, but I have no idea how else to say
>>>>that:
>>>>
>>>>print "Location:...
>>>>/url.cgi?\$patient_id=\$patient_id&\$exam_date=\$exam_da te&\$refer_clinic=\$refer_clinic\n\n";
>>>>
>>>>isn't working.
>>>>
>>>>After it redirects I see the url, inclusive of the ? and everything
>>>>after
>>>>it in the browser's address bar, but the variables don't get passed.
>>>
>>> To follow up...
>>>
>>> I've renamed my scripts with the extension 'pl.'
>>> My redirect precedes the document type header.
>>> I've tried:
>>>
>>> .pl?var1=var1
>>> .pl?var1=$var1
>>> .pl?var1=\$var1
>>> .pl?$var1=$var1
>>> .pl?\$var1=\$var1
>>> .pl?var1=$formdata{'$var1'}
>>> .pl?var1=\$formdata{'$var1'}
>>>
>>> all to no avail.
>>
>>Which begs the question, if you're not using CGI.pm, how are you accessing
>>the variables? If you're using code that only processes post requests,
>>then
>>it's not surprising that nothing turns up in your second script. Without
>>seeing the code you're using to get the variables, however, there's no way
>>of helping you at this point.
>>
> Here is the code to access the variables, followed by three of the 60
> variables I'm trying to pass:
>
> $buffer = "";
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
You're not posting the data on the redirect, so you have to read the query
string instead. I would recommend using CGI.pm, but if you're determined to
stay with what you have you're going to have to start checking how your data
is arriving and process it accordingly.
Matt
Re: Redirect and pass variables
am 16.11.2005 01:12:03 von Ed Jay
"Matt Garrish" wrote:
>
>"Ed Jay" wrote in message
>news:m3ujn1t48j4uh2c0cu61ehfliclut0p8e1@4ax.com...
>> "Matt Garrish" wrote:
>>
>>>
>>>"Ed Jay" wrote in message
>>>news:5q9jn1lng6u86patiu4glq0n4urj53e4lg@4ax.com...
>>>> Ed Jay wrote:
>>>>
>>>>>"Matt Garrish" wrote:
>>>>>
>>>>>>
>>>>>>"Ed Jay" wrote in message
>>>>>>news:4mein1hrgppkcd63kqnehbort15tn7r1f1@4ax.com...
>>>>>>>I have a multi-file script (Not cgi). I read in variables from an
>>>>>>> HTML-based form, add values for a few more variables using a form,
>>>>>>> and
>>>>>>> then submit the new values plus the original values, in hidden form
>>>>>>> fields, to the next Perl script.
>>>>>>>
>>>>>>> If a couple of variables have zero value, I want to skip processing
>>>>>>> on
>>>>>>> the
>>>>>>> 'next' page and redirect to page2n. I'm using the following simple
>>>>>>> logic
>>>>>>> and redirect in Page n's script:
>>>>>>>
>>>>>>> Read in previous variables.
>>>>>>>
>>>>>>> if ($var1 + var2 == 0) {print 'Status: 302 Moved', "\r\n", 'Location:
>>>>>>> /cgi-bin/pagen2.cgi', "\r\n\r\n";}
>>>>>>>
>>>>>>
>>>>>>Please don't retype code. It makes it difficult to know what you're
>>>>>>real
>>>>>>problem is (var2 should be $var2 above, one would assume). Also, it's
>>>>>>strange that they aren't cgi scripts, but they have cgi extensions and
>>>>>>use
>>>>>>the gateway...
>>>>>>
>>>>>>> Problem is, the values for all previous variable do not pass to
>>>>>>> page2n.
>>>>>>
>>>>>>Because you didn't pass them. All you did was redirect:
>>>>>>
>>>>>>print "Location: /cgi-bin/pagen2.cgi?var1=$var1&var2=$var2\n\n";
>>>>>>
>>>>>>Of course, you may want to consider uri escaping the variables before
>>>>>>including them in the string, but that's left as an exercise for you...
>>>>>>
>>>>>Pardon me for retyping the code, but I have no idea how else to say
>>>>>that:
>>>>>
>>>>>print "Location:...
>>>>>/url.cgi?\$patient_id=\$patient_id&\$exam_date=\$exam_d ate&\$refer_clinic=\$refer_clinic\n\n";
>>>>>
>>>>>isn't working.
>>>>>
>>>>>After it redirects I see the url, inclusive of the ? and everything
>>>>>after
>>>>>it in the browser's address bar, but the variables don't get passed.
>>>>
>>>> To follow up...
>>>>
>>>> I've renamed my scripts with the extension 'pl.'
>>>> My redirect precedes the document type header.
>>>> I've tried:
>>>>
>>>> .pl?var1=var1
>>>> .pl?var1=$var1
>>>> .pl?var1=\$var1
>>>> .pl?$var1=$var1
>>>> .pl?\$var1=\$var1
>>>> .pl?var1=$formdata{'$var1'}
>>>> .pl?var1=\$formdata{'$var1'}
>>>>
>>>> all to no avail.
>>>
>>>Which begs the question, if you're not using CGI.pm, how are you accessing
>>>the variables? If you're using code that only processes post requests,
>>>then
>>>it's not surprising that nothing turns up in your second script. Without
>>>seeing the code you're using to get the variables, however, there's no way
>>>of helping you at this point.
>>>
>> Here is the code to access the variables, followed by three of the 60
>> variables I'm trying to pass:
>>
>> $buffer = "";
>> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>
>You're not posting the data on the redirect, so you have to read the query
>string instead. I would recommend using CGI.pm, but if you're determined to
>stay with what you have you're going to have to start checking how your data
>is arriving and process it accordingly.
>
Matt, I think you hit the nail on the head about the same time as I was
led to. I'm reading the form data as standard (Post), but redirecting via
the URL, which is submitting via Get.
>
That I'm seeing the correct string in the browser addy field tells me the
data is being sent properly....at least the way it's being told.
--
Ed Jay (remove M to respond by email)
Re: Redirect and pass variables
am 18.11.2005 22:01:58 von Joe Smith
Ed Jay wrote:
> The scripts are written in Perl, but I don't use the CGI module.
A script is considered to be a "CGI script" if it executed by
a web server's Common Gateway Interface. The lack of "use CGI;"
does not change this.
-Joe
Re: Redirect and pass variables
am 18.11.2005 22:05:55 von Joe Smith
Ed Jay wrote:
>>Please don't retype code. It makes it difficult to know what you're real
>>problem is.
>
> Pardon me for retyping the code, but I have no idea how else to say that:
>
> print "Location:...
> /url.cgi?\$patient_id=\$patient_id&\$exam_date=\$exam_date&\ $refer_clinic=\$refer_clinic\n\n";
>
> isn't working.
There, you've done it again. (Three periods after "Location:", indeed.)
You should copy-and-paste the actual code, not re-type it.
-Joe
Re: Redirect and pass variables
am 21.11.2005 18:32:07 von Ed Jay
Joe Smith wrote:
>Ed Jay wrote:
>
>> The scripts are written in Perl, but I don't use the CGI module.
>
>A script is considered to be a "CGI script" if it executed by
>a web server's Common Gateway Interface. The lack of "use CGI;"
>does not change this.
> -Joe
Doesn't "use CGI" tell Perl to load the CGI.pm module which it otherwise
wouldn't do?
--
Ed Jay (remove M to respond by email)
Re: Redirect and pass variables
am 21.11.2005 19:14:50 von Paul Lalli
Ed Jay wrote:
> Joe Smith wrote:
>
> >Ed Jay wrote:
> >
> >> The scripts are written in Perl, but I don't use the CGI module.
> >
> >A script is considered to be a "CGI script" if it executed by
> >a web server's Common Gateway Interface. The lack of "use CGI;"
> >does not change this.
> > -Joe
>
> Doesn't "use CGI" tell Perl to load the CGI.pm module which it otherwise
> wouldn't do?
Yes. And...? What are you actually trying to ask?
CGI.pm is simply a module that provides an easy-to-use interface to the
Common Gateway Interface. There's no reason at all you can't use CGI
without `use CGI;`. (This is PurlGurl's cue to come into the
conversation, by the way. . . )
Paul Lalli
Re: Redirect and pass variables
am 21.11.2005 19:21:52 von Ed Jay
"Paul Lalli" wrote:
>Ed Jay wrote:
>> Joe Smith wrote:
>>
>> >Ed Jay wrote:
>> >
>> >> The scripts are written in Perl, but I don't use the CGI module.
>> >
>> >A script is considered to be a "CGI script" if it executed by
>> >a web server's Common Gateway Interface. The lack of "use CGI;"
>> >does not change this.
>> > -Joe
>>
>> Doesn't "use CGI" tell Perl to load the CGI.pm module which it otherwise
>> wouldn't do?
>
>Yes. And...? What are you actually trying to ask?
>
>CGI.pm is simply a module that provides an easy-to-use interface to the
>Common Gateway Interface. There's no reason at all you can't use CGI
>without `use CGI;`. (This is PurlGurl's cue to come into the
>conversation, by the way. . . )
>
Thanks, Paul. I understand. I got the impression from Joe's comment that
regardless of whether or not one uses "Use CGI" that Perl would still use
the module.
--
Ed Jay (remove M to respond by email)
Re: Redirect and pass variables
am 24.11.2005 10:24:20 von Joe Smith
Ed Jay wrote:
> Joe Smith wrote:
>
>
>>Ed Jay wrote:
>>
>>
>>>The scripts are written in Perl, but I don't use the CGI module.
>>
>>A script is considered to be a "CGI script" if it executed by
>>a web server's Common Gateway Interface. The lack of "use CGI;"
>>does not change this.
>> -Joe
>
>
> Doesn't "use CGI" tell Perl to load the CGI.pm module which it otherwise
> wouldn't do?
True but irrelevant. A "CGI script" can be written in FORTRAN,
in the Bourne shell, in TCL, and even in COBOL. None of those
use CGI.pm but they are CGI programs because they were designed
to operate in the Common Gateway Interface (CGI) environment.
-Joe
Re: Redirect and pass variables
am 24.11.2005 14:19:23 von Sherm Pendley
Joe Smith writes:
> True but irrelevant. A "CGI script" can be written in FORTRAN,
> in the Bourne shell, in TCL, and even in COBOL. None of those
> use CGI.pm but they are CGI programs because they were designed
> to operate in the Common Gateway Interface (CGI) environment.
The converse is also true, BTW. A Perl script that uses CGI.pm can be
run from a command-line for debugging, or under mod_perl. In neither
case is it running in a CGI environment.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org