Re: A regexp from paypal
by renodino (Curate) on Nov 25, 2007 at 20:52 UTC
|
| [reply] |
Re: A regexp from paypal
by Corion (Patriarch) on Nov 25, 2007 at 20:55 UTC
|
You can post this script as a reply to your root node. Please wrap it in <code>...</code> tags so it renders and downloads nicely.
If the script is hand-rolling its own parameter decoding, it has likely other deficiencies. Normally, you want to use CGI.pm for handling all the CGI decoding.
| [reply] [d/l] |
|
That is the funny thing, I am adapting a script put out by PayPal that had their own handrolled CGI and attempting to make it use the CGI module.
The problem is I need to get a just the straight post string to add a parameter and send it off, param() isn't letting me do it. Any ideas on how to access the raw post string using the CGI module, right now the script does this:
read (STDIN, $query, $ENV{'CONTENT_LENGTH'});
$query .= '&cmd=_notify-validate';
There has to be something in CGI to do that read() line. | [reply] [d/l] |
|
| [reply] |
|
|
|
Re: A regexp from paypal
by bart (Canon) on Nov 26, 2007 at 07:51 UTC
|
It looks like something lifted directly out of cgi-lib.pl, which is, well, ancient. It really looks like some beginner programmer wrote his own CGI parameter processing code, borrowing here and there... (And, haven't we all...) There really is no need to use pack "C", ... any more, as Perl 5, which has been around for more than 12 years, has chr. (Perl 4 did not.)
So: you might use this code to learn some Perl, but please don't copy it, as it can really not be considered "best practices" any more. | [reply] [d/l] |
|
Yep I know that, just need to know what it did so that when I was rewriting this program to use CGI that I didn't leave something out. I've gotten past that now and am having trouble implementing CGI.pm to send back the post request to the server. When I post the query object back PayPal doesn't like the way it's formatted. I am trying to resist using the read() function to get the post string but the CGI module isn't making this too easy. Does anyone know how I can get at the post data and add a var (I've done this using param() ) and then send it back using LWP without screwing up the format?
| [reply] [d/l] |
Re: A regexp from paypal
by Anonymous Monk on Nov 26, 2007 at 07:38 UTC
|
| [reply] [d/l] |