For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > June 2004 > Help! - Need a CGI redirect which passes a querystring value









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help! - Need a CGI redirect which passes a querystring value
Damon

2004-06-25, 6:48 pm

Hi all,

I'm not very familiar with Perl and could use some help.

I need to have the page "myPage.cgi?cnt=60" redirect to
"myPage.aspx?cnt=60". Can anyone give me an easy script for doing this
redirect?

Thanks for any help you can offer.

-Damon
Matt Garrish

2004-06-25, 6:48 pm


"Damon" <damon@tribbledesigns.com> wrote in message
news:fcd2095.0406211800.d1f3058@posting.google.com...
> Hi all,
>
> I'm not very familiar with Perl and could use some help.
>
> I need to have the page "myPage.cgi?cnt=60" redirect to
> "myPage.aspx?cnt=60". Can anyone give me an easy script for doing this
> redirect?
>


Assuming that is the only variable you're expecting, you could use the
following in myPage.cgi:

use strict;
use warnings;
use CGI;

my $q = new CGI;

my $cnt = $q->param('cnt');

print $q->redirect("http://wherever/myPage.aspx?cnt=$cnt");


Matt


Woody PurlGurl IV

2004-06-25, 6:48 pm

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message news:<ExMBc.8742$MU4.440144@news20.bellglobal.com>...
> "Damon" <damon@tribbledesigns.com> wrote in message
> news:fcd2095.0406211800.d1f3058@posting.google.com...
>
> Assuming that is the only variable you're expecting, you could use the
> following in myPage.cgi:
>
> use strict;
> use warnings;
> use CGI;


Whoa! Isn't this _precisely_ the sort of situation where CGI.pm is
overkill? After all, all this takes is regex substitution on a cgi
environment variable:

$ENV{REQUEST_URI} =~ s/myPage.cgi/myPage.aspx/;
$redirect = "http://" . $ENV{HTTP_HOST} . "/" . $ENV{REQUEST_URI};
print "Content-type: text/html\n\n";
print "Location: $redirect";

PurlGurl, do you have a woody for me now too? WooHoo!
Damon

2004-06-25, 6:48 pm

Thanks Matt,

My only problem now is that this is all happening on a windows server.
The code you provided doesn't seem to work in this environment. I just
get the following error: "%1 is not a valid Win32 application."

You see, we have several links hard-coded into our desktop application
like "http://www.mydomain.com/myPage.cgi?cnt=50" which now need to
point to "http://www.mydomain.com/myPage.aspx?cnt=50".

Is there any way to make myPage.cgi?cnt=50 redirect and preserve the
querystring on a windows server?

-Damon

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message news:<ExMBc.8742$MU4.440144@news20.bellglobal.com>...
> "Damon" <damon@tribbledesigns.com> wrote in message
> news:fcd2095.0406211800.d1f3058@posting.google.com...
>
> Assuming that is the only variable you're expecting, you could use the
> following in myPage.cgi:
>
> use strict;
> use warnings;
> use CGI;
>
> my $q = new CGI;
>
> my $cnt = $q->param('cnt');
>
> print $q->redirect("http://wherever/myPage.aspx?cnt=$cnt");
>
>
> Matt

Gunnar Hjalmarsson

2004-06-25, 6:48 pm

Damon wrote:
> Is there any way to make myPage.cgi?cnt=50 redirect and preserve the
> querystring on a windows server?


I don't understand why Matt's suggestion would not work on Windows.
Anyway, as long as the key and value only consist of ASCII characters,
this should be sufficient:

print 'Location: http://www.mydomain.com/myPage.aspx?',
"$ENV{QUERY_STRING}\n\n";

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Matt Garrish

2004-06-25, 6:48 pm


"Woody PurlGurl IV" <woody4purlgurl@yahoo.com> wrote in message
news:eeec6142.0406221441.2fcee17@posting.google.com...
> "Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message

news:<ExMBc.8742$MU4.440144@news20.bellglobal.com>...
>
> Whoa! Isn't this _precisely_ the sort of situation where CGI.pm is
> overkill? After all, all this takes is regex substitution on a cgi
> environment variable:
>
> $ENV{REQUEST_URI} =~ s/myPage.cgi/myPage.aspx/;
> $redirect = "http://" . $ENV{HTTP_HOST} . "/" . $ENV{REQUEST_URI};
> print "Content-type: text/html\n\n";
> print "Location: $redirect";
>


Uh, why are you sending an html content-type header? You do realize that
you're just going to print the new url to the browser, right?

More to the point, though, you're assuming that those variables are
available. In his follow-up post he mentions he's on a Windows server, and
IIS does not recognize REQUEST_URI. Another reason to push people in the
direction of CGI.pm over hand-rolled "solutions"... : )

Matt


Matt Garrish

2004-06-25, 6:48 pm


"Damon" <damon@tribbledesigns.com> wrote in message
news:fcd2095.0406221552.429e37ea@posting.google.com...
> Thanks Matt,
>
> My only problem now is that this is all happening on a windows server.
> The code you provided doesn't seem to work in this environment. I just
> get the following error: "%1 is not a valid Win32 application."
>
> You see, we have several links hard-coded into our desktop application
> like "http://www.mydomain.com/myPage.cgi?cnt=50" which now need to
> point to "http://www.mydomain.com/myPage.aspx?cnt=50".
>
> Is there any way to make myPage.cgi?cnt=50 redirect and preserve the
> querystring on a windows server?
>


<please don't top-post>

The script I provided should work regardless of what value of cnt is passed
to it. The error you note sounds like it's in the way that you have the .cgi
extension mapped. Do any .cgi scripts work on your server?

Matt


John Bokma

2004-06-25, 6:48 pm

Woody PurlGurl IV wrote:

> "Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message news:<ExMBc.8742$MU4.440144@news20.bellglobal.com>...
>
>
>
> Whoa! Isn't this _precisely_ the sort of situation where CGI.pm is
> overkill? After all, all this takes is regex substitution on a cgi
> environment variable:
>
> $ENV{REQUEST_URI} =~ s/myPage.cgi/myPage.aspx/;


Um... if my URI is eh... myP%61ge.cgi?

and why are you rewriting myPagescgi to myPage.aspx?

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
raymond

2004-06-25, 6:48 pm

Should not be sent content-type for redirection so need this line for below example

print "Content-type: text/html\n\n"; **no need


raymond raj

woody4purlgurl@yahoo.com (Woody PurlGurl IV) wrote in message news:<eeec6142.0406221441.2fcee17@posting.google.com>...
> "Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message news:<ExMBc.8742$MU4.440144@news20.bellglobal.com>...
>
> Whoa! Isn't this _precisely_ the sort of situation where CGI.pm is
> overkill? After all, all this takes is regex substitution on a cgi
> environment variable:
>
> $ENV{REQUEST_URI} =~ s/myPage.cgi/myPage.aspx/;
> $redirect = "http://" . $ENV{HTTP_HOST} . "/" . $ENV{REQUEST_URI};
> print "Content-type: text/html\n\n";
> print "Location: $redirect";
>
> PurlGurl, do you have a woody for me now too? WooHoo!

John Bokma

2004-06-25, 6:48 pm

raymond wrote:

> Should not be sent content-type for redirection so need this line for below example
>
> print "Content-type: text/html\n\n"; **no need
>
>
> raymond raj


If you don't top-post, it's more easy to reply for you, and for us to
understand.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Alan J. Flavell

2004-06-25, 6:48 pm

On Wed, 22 Jun 2004, raymond blurted out atop a fullquote:

> Should not be sent content-type for redirection


Wrong. RTFRFC. This is off-topic for a Perl language group so I'll
say no more about that. Discerning usenauts know that anything posted
in TOFU format needs to be distrusted.
Joe Smith

2004-06-25, 6:48 pm

Woody PurlGurl IV wrote:

> $ENV{REQUEST_URI} =~ s/myPage.cgi/myPage.aspx/;
> $redirect = "http://" . $ENV{HTTP_HOST} . "/" . $ENV{REQUEST_URI};
> print "Content-type: text/html\n\n";
> print "Location: $redirect";


You've got the newlines in the wrong location.

$ENV{REQUEST_URI} =~ s/myPage\.cgi/myPage.aspx/;
$redirect = "http://" . $ENV{HTTP_HOST} . "/" . $ENV{REQUEST_URI};
print <<EOM;
Location: $redirect
Content-type: text/html

<html><body>Your browser should have automatically gone to
<a href="$redirect">$redirect</a></body></html>
EOM

-Joe
Woody PurlGurl IV

2004-06-25, 6:48 pm

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message news:<754Cc.25916$Nz.1081292@news20.bellglobal.com>...
> "Woody PurlGurl IV" <woody4purlgurl@yahoo.com> wrote in message
> news:eeec6142.0406221441.2fcee17@posting.google.com...
> news:<ExMBc.8742$MU4.440144@news20.bellglobal.com>...
>
> Uh, why are you sending an html content-type header? You do realize that
> you're just going to print the new url to the browser, right?


Just a little cargo cult code to make you feel at home. Let's see,
what's worse, one needless line, or including a 100K library
needlessly?

> More to the point, though, you're assuming that those variables are
> available. In his follow-up post he mentions he's on a Windows server, and
> IIS does not recognize REQUEST_URI. Another reason to push people in the
> direction of CGI.pm over hand-rolled "solutions"... : )


Baloney. Trust me, there are cgi-environment variables on Windows
that should do the trick. Knowing them and/or knowing how to find
them is a _good_thing_.

Although others beside you have correctly criticized my code in parts,
_nobody_ else has defended your needless use of CGI.pm. In particular
I like Gunnar's solution:

print 'Location: http://www.mydomain.com/myPage.aspx?',
"$ENV{QUERY_STRING}\n\n";

Note the similarity of concept to my conception. The "ayes" have it
;)
Matt Garrish

2004-06-25, 6:48 pm


"Woody PurlGurl IV" <woody4purlgurl@yahoo.com> wrote in message
news:eeec6142.0406230251.6ba6304f@posting.google.com...
>
and[color=darkred]
>
> Baloney. Trust me, there are cgi-environment variables on Windows
> that should do the trick. Knowing them and/or knowing how to find
> them is a _good_thing_.
>
> Although others beside you have correctly criticized my code in parts,
> _nobody_ else has defended your needless use of CGI.pm. In particular
> I like Gunnar's solution:
>


Why would anyone post a defense of a working solution? And why provide
someone a non-working and non-portable solution as you attempted to do? I
see your alter-ego is just as out-to-lunch as the original.

Matt


Alan J. Flavell

2004-06-25, 6:48 pm

On Wed, 23 Jun 2004, Matt Garrish revealed to all and sundry that:

> "Woody PurlGurl IV" <woody4purlgurl@yahoo.com> wrote in message



Try reading this group for a while. Lurk before you leap.
[color=darkred]
> Why would anyone post a defense of a working solution? And why provide
> someone a non-working and non-portable solution as you attempted to do? I
> see your alter-ego is just as out-to-lunch as the original.


Looks that way to me, too.

As for the history of Gunnar recommending solutions which bypass
CGI.pm, the relevant discussions from past exchanges can be consulted
at the usual news archives. I don't see any benefit in going over
them yet again.
Gunnar Hjalmarsson

2004-06-25, 6:48 pm

Alan J. Flavell wrote:
> As for the history of Gunnar recommending solutions which bypass
> CGI.pm, the relevant discussions from past exchanges can be
> consulted at the usual news archives.


Even if I disagree on your using of the word "bypass", I won't argue
this time.

> I don't see any benefit in going over them yet again.


That's fair. So, why did you refer to them in the first place? If you
disapprove of the suggestion I posted in this thread, wouldn't it have
been more suitable to say so?

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Alan J. Flavell

2004-06-25, 6:48 pm

On Wed, 23 Jun 2004, Gunnar Hjalmarsson wrote:

>
> That's fair. So, why did you refer to them in the first place?


To encourage anyone who's seriously interested to go and check a news
archive, if they haven't already done so.

> If you disapprove of the suggestion


My views are more complex than that, as I thought I had made clear
before. But I don't want to get involved in troll-feeding again:
you are sufficiently acquainted with the climate around here to work
out for yourself whether you want to get dragged-in or not, and I've
really said all that I thought it worthwhile to say.

good luck.

--
I'm afraid you have fallen into a well-known trap of understanding
what is going on here. -Phil Hazel on exim-users
Damon

2004-06-25, 6:48 pm

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message news:<fb4Cc.25944$Nz.1083541@news20.bellglobal.com>...
> "Damon" <damon@tribbledesigns.com> wrote in message
> news:fcd2095.0406221552.429e37ea@posting.google.com...
>
> <please don't top-post>
>
> The script I provided should work regardless of what value of cnt is passed
> to it. The error you note sounds like it's in the way that you have the .cgi
> extension mapped. Do any .cgi scripts work on your server?
>
> Matt


Hi all,

Sorry about the top-posting.

Thanks to all for your help. Both Matt and Gunnar's solutions solved
my problem. I found out that the Windows server I am hosted on was not
correctly setup to process CGI. Once this was fixed, both scripts
worked.

Thanks for all your help! I really appreciate it...

-Damon
Woody PurlGurl IV

2004-06-25, 6:48 pm

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
>
> Why would anyone post a defense of a working solution? And why provide
> someone a non-working and non-portable solution as you attempted to do?


Its called a "trade-off". Your approach may be portable, but for this
one-off script the performance cost of using CGI.pm is unnecessary,
and depending on volume, perhaps even prohibitive. And certainly
avoidable.

Discussions in this group occasionally concede that using CGI.pm may
not always be necessary. This in my opinion is a perfect scenario.
Why load literally 1000 times more code than necessary (100 K vs 100
bytes, give or take)?

> I see your alter-ego is just as out-to-lunch as the original.


A) Of course this must be PurlGurl's alter ego. After all, PurlGurl
is the only person on planet earth that ever uses the phrase "cargo
cult". Oops, except for the compilers of foldoc, apparently.

B) You are the one who is "out to lunch" if you are not willing to
concede even the _possibility_ of a valid trade-off in this scenario.
Purl Gurl

2004-06-25, 6:48 pm

Woody PurlGurl IV wrote:

I am humored by men who claim a toothpick to be a woody.

Inherently, men make poor carpenters, save for Jesus.
Men believe two inches is a foot.


Purl Gurl
Matt Garrish

2004-06-25, 6:48 pm


"Woody PurlGurl IV" <woody4purlgurl@yahoo.com> wrote in message
news:eeec6142.0406231540.29165841@posting.google.com...
> "Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
>
> Its called a "trade-off". Your approach may be portable, but for this
> one-off script the performance cost of using CGI.pm is unnecessary,
> and depending on volume, perhaps even prohibitive. And certainly
> avoidable.
>


Based on what fact? Both mod_perl and aspx scripts only need to compile once
(and with mod_perl you can precompile the modules). You need to find a
better argument.

>
> Discussions in this group occasionally concede that using CGI.pm may
> not always be necessary. This in my opinion is a perfect scenario.
> Why load literally 1000 times more code than necessary (100 K vs 100
> bytes, give or take)?
>


I never said it was the only way. You jumped at the chance to trash CGI.pm
and posted some garbage. I pointed out you were wrong. I never said anything
to the people who posted workable solutions.

Matt


Gunnar Hjalmarsson

2004-06-25, 6:48 pm

Matt Garrish wrote:
> Both mod_perl and aspx scripts only need to compile once (and with
> mod_perl you can precompile the modules).


Don't take for granted that mod_perl is an available option. The OP in
this thread used the wording "the Windows server I am hosted on".

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Woody PurlGurl IV

2004-06-25, 6:48 pm

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
>
> I never said it was the only way. You jumped at the chance to trash CGI.pm
> and posted some garbage. I pointed out you were wrong. I never said anything
> to the people who posted workable solutions


Get a grip. Though my code, which I guess I should have said was
untested, was certainly not perfect, I don't think it was "garbage"
either, especially considering the underlying concept -- avoiding the
overhead of CGI.pm for a one-off script -- was a valid argument.

And I _never_ "jumped at the chance to trash" CGI.pm. First of all, I
am not so personally wound up with CGI.pm, as you seem to be (which is
quite odd considering your last name is not Stein), that I jump at the
chance to either trash or defend it. I just pointed out that this
might be a situation where it was inappropriate. If in your world
view that is "trash"-ing, get thee to a psychiatrist.
Purl Gurl

2004-06-25, 6:48 pm

Gunnar Hjalmarsson wrote:

> A known troll wrote:


[color=darkred]
> Don't take for granted that mod_perl is an available option. The OP in
> this thread used the wording "the Windows server I am hosted on".


If I recall correctly, versions .86 and upward of CGI.pm
are compatible with mod_perl. Earlier versions are not.
Might be .82 and upward. Check me on this. Only very
recent versions of CGI.pm will run under mod_perl.

Many, perhaps a majority of servers do not run mod_perl.

When CGI.pm is loaded into mod_perl, overhead efficiency
loss is still five-hundred percent or more.

Use of Stein's CGI module is ok for some, but very few
circumstances. Overall, his module is amongst the worst
of programming choices.


Purl Gurl
--
Some members of the Perl Community will victimize
your family with vulgar obscene phone calls from
midnight to dawn, daily.
Matt Garrish

2004-06-25, 6:48 pm


"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:2jvk8iF167949U1@uni-berlin.de...
> Matt Garrish wrote:
>
> Don't take for granted that mod_perl is an available option. The OP in
> this thread used the wording "the Windows server I am hosted on".
>


Granted, but my point was simply that that line of argument is fast becoming
out-dated.

Matt


Matt Garrish

2004-06-25, 6:48 pm


"Woody PurlGurl IV" <woody4purlgurl@yahoo.com> wrote in message
news:eeec6142.0406240330.42acf4a@posting.google.com...
> "Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
CGI.pm[color=darkred]
anything[color=darkred]
>
> Get a grip. Though my code, which I guess I should have said was
> untested, was certainly not perfect, I don't think it was "garbage"
> either, especially considering the underlying concept -- avoiding the
> overhead of CGI.pm for a one-off script -- was a valid argument.
>
> And I _never_ "jumped at the chance to trash" CGI.pm. First of all, I
> am not so personally wound up with CGI.pm, as you seem to be (which is
> quite odd considering your last name is not Stein), that I jump at the
> chance to either trash or defend it. I just pointed out that this
> might be a situation where it was inappropriate. If in your world
> view that is "trash"-ing, get thee to a psychiatrist.


So calling it cargo cult code is not a bad thing? Recommending the CGI
module is a better alternative to half-baked attempts at cgi coding. If you
can't even take the time to check your code, please don't post it here.

Matt


Randal L. Schwartz

2004-06-25, 6:48 pm

>>>>> "Gunnar" == Gunnar Hjalmarsson <noreply@gunnar.cc> writes:

Gunnar> Don't take for granted that mod_perl is an available option. The OP in
Gunnar> this thread used the wording "the Windows server I am hosted on".

mod_perl works fine on Windows Apache.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Gunnar Hjalmarsson

2004-06-25, 6:48 pm

Randal L. Schwartz wrote:
> Gunnar Hjalmarsson wrote:
>
> mod_perl works fine on Windows Apache.


You misunderstood me, Randal. "Hosted" was the intended keyword. It's
(unfortunately) very unusual that mod_perl is available to web sites
on shared servers (whether the platforms are *nix or Windows).

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Purl Gurl

2004-06-25, 6:48 pm

Gunnar Hjalmarsson wrote:

> Randal L. Schwartz wrote:
[color=darkred]
[color=darkred]
> You misunderstood me, Randal. "Hosted" was the intended keyword. It's
> (unfortunately) very unusual that mod_perl is available to web sites
> on shared servers (whether the platforms are *nix or Windows).


Here is a statistical survey for mod_perl usage.

http://theory.uwinnipeg.ca/modperl/outstanding/stats/netcraft.html

A reader should carefully interpret that graph. You will note
a sudden increase in mod_perl usage based on hostname, but a
relatively low increase in mod_perl usage based on unique
ip addresses.

Appears this graph is skewed because of virtual hosting
upon single ip address server machines.

Compared to the total number of servers on the net, which
is actually unknown but very high, mod_perl is not commonly
used on servers.


Purl Gurl
--
Our family has identified five U.S. military servers and
one Department of Defense server being used by some in the
Perl Community to commit crimes. Homeland Security and
the Department of Defense have been notified.
Woody PurlGurl IV

2004-06-25, 6:49 pm

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message news:<yMACc.31755$Nz.1638109@news20.bellglobal.com>...
> "Woody PurlGurl IV" <woody4purlgurl@yahoo.com> wrote in message
>
> So calling it cargo cult code is not a bad thing? Recommending the CGI
> module is a better alternative to half-baked attempts at cgi coding. If you
> can't even take the time to check your code, please don't post it here.


A) Who cares if "calling it cargo cult code" is a "bad thing"? What
is this, kindergarden? Mr Stein, Mr Stein, somebody called CGI.pm
cargo cult code. Grow up.

B) I didn't intend to call CGI.pm "cargo cult code". I was referring
to its usage in the given context. I use CGI.pm all the time,
including along with HTML::Template, within the context of
CGI::Application. Its just that I'm convinced that in the OP's
context it was needless.

C) I called MY OWN code, or at least one line of it, cargo cult code.
This is called self deprecation. If you can't even take the time to
have a sense of humor don't post here. ROTFLMAO.

C) Regardless of my code not being perfect, the concept that CGI.pm
could perhaps be overkill in this situation was the crux of my post.
You refuse to acknowledge this, apparently because you'd have to admit
you're not perfect. The code's the easy stuff: if its slightly off,
its easy enough to fix, as this very thread demonstrated. Recognizing
mis-applied concepts is substantially harder. I'm probably wasting my
breath though, you don't seem to get it.
Matt Garrish

2004-06-25, 6:49 pm


"Woody PurlGurl IV" <woody4purlgurl@yahoo.com> wrote in message
news:eeec6142.0406241511.2415d651@posting.google.com...
>
> C) Regardless of my code not being perfect, the concept that CGI.pm
> could perhaps be overkill in this situation was the crux of my post.
> You refuse to acknowledge this, apparently because you'd have to admit
> you're not perfect.
>


Yes, that must be it. This is all a contest to see who is perfect, and I win
because my code is bullet-proof whereas yours prints part of a url to the
browser. There are two solutions that work, neither of which you posted. If
you want a hand for almost getting it right, you're not going to get it from
me. If you want a debate of the merits of using CGI, as Alan noted it's a
tired argument you're welcome to have with yourself.

Matt


Purl Gurl

2004-06-25, 6:49 pm

Woody PurlGurl IV wrote:

21:19:49 -0700 ... 1.2.5-0.woody.1

Our androids are smarter than most participants here.


Feel free to trash CGI.pm anytime. I trash it on a regular basis.


Purl Gurl
Purl Gurl

2004-06-25, 6:49 pm

Purl Gurl wrote:

> Woody PurlGurl IV wrote:


> 21:19:49 -0700 ... 1.2.5-0.woody.1


> Our androids are smarter than most participants here.



However, you came very close to being banished.

21:24:02 -0700 GET /~ HTTP/1.1

Our androids do not like that.


Purl Gurl
John Bokma

2004-06-25, 6:49 pm

Purl Gurl wrote:

> Purl Gurl wrote:
>
>
>
>
> However, you came very close to being banished.
>
> 21:24:02 -0700 GET /~ HTTP/1.1
>
> Our androids do not like that.


LOL

an·droid
adj.

Possessing human features.

n.

An automaton that is created from biological materials and
resembles a human. Also called humanoid.

http://dictionary.reference.com/search?q=androids&r=67

Since you are not human, I doubt your "bots" are :-D. Otherwise, let
them post here.


--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Woody PurlGurl IV

2004-06-26, 8:56 am

"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message news:<6vLCc.39069$MU4.1081604@news20.bellglobal.com>...
> "Woody PurlGurl IV" <woody4purlgurl@yahoo.com> wrote in message
> news:eeec6142.0406241511.2415d651@posting.google.com...
>
> Yes, that must be it. This is all a contest to see who is perfect, and I win
> because my code is bullet-proof whereas yours prints part of a url to the
> browser. There are two solutions that work, neither of which you posted. If
> you want a hand for almost getting it right, you're not going to get it from
> me. If you want a debate of the merits of using CGI, as Alan noted it's a
> tired argument you're welcome to have with yourself.


What I tried to engage in was a debate on the merits of using CGI,
_in_this_particular_situation_. All you've done is sink your teeth
into the fact that my code was not perfect. I feel sorry for your end
users, considering you apparently are incapabable of considering
tradeoffs; everything looks like a nail to you cause the only tool you
have is a hammer.

PS....here is my response to you insisting on having the last word:

<fingers_in_ears>
LALALALALALALALALALA
</fingers_in_ears>
krakle

2004-06-26, 8:56 pm

woody4purlgurl@yahoo.com (Woody PurlGurl IV) wrote in message news:<eeec6142.0406221441.2fcee17@posting.google.com>...
> Whoa! Isn't this _precisely_ the sort of situation where CGI.pm is
> overkill? After all, all this takes is regex substitution on a cgi
> environment variable:
>
> $ENV{REQUEST_URI} =~ s/myPage.cgi/myPage.aspx/;
> $redirect = "http://" . $ENV{HTTP_HOST} . "/" . $ENV{REQUEST_URI};
> print "Content-type: text/html\n\n";
> print "Location: $redirect";



haha... nice try.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com