Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
dizzywhip
Dec 23, 2005

I'm having trouble with get and post data in perl. Previously I was extracting arguments using the CGI module, as in $cgi->param($key). That was working fine with just get arguments, but I found out that if I had both post and get arguments it would only find the post args.

So I did some research and made a function that did it manually, but I ran into a problem with getting post data. All the information I found said to use read(STDIN, $request, $ENV{'CONTENT_LENGTH'}), but it fails every time.

So I guess I have three questions. Is there any way to get the CGI module to fetch both get and post arguments? And if not, what's wrong the method I'm using to extract post data manually? Lastly, will I even be able to grab both get and post data this way? I was assuming I'd be able to concatenate the post and get data and then process them normally.

Adbot
ADBOT LOVES YOU

dizzywhip
Dec 23, 2005


Thanks

dizzywhip
Dec 23, 2005

One more question - I've got the GD module installed so I can do some work with image files. It works fine except for jpeg support, which I've been trying to get working all day with no luck, it's driving me crazy. It seems gdlib won't install with jpeg support.

I've installed jpeg6b properly, and when I run configure for gdlib it seems to recognize this:

quote:

** Configuration summary for gd 2.0.34:

Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Fontconfig library: yes
Support for Xpm library: yes
Support for pthreads: yes

Before I installed jpeg6b it had said no for jpeg support, so it seems to have found the new libraries.

Then I do make and make install, which seem to work fine, but gdlib-config still tells me it has no jpeg support, and I get no jpeg support in perl after reinstalling GD. Any ideas?

dizzywhip
Dec 23, 2005

What's the most efficient way to do multiple substitutions at once? There's lots of information online about doing multiple matches at once, but I can't find anything about substitutions.

For example, is it possible to do something like this:

code:
$text =~ s/string1/string2/g;
$text =~ s/string3/string4/g;
But do both substitutions at the same time, so that perl is not scanning the same text twice in a row?

dizzywhip
Dec 23, 2005

Thanks for the replies, seems to work well.

Triple Tech posted:

Does it really matter?

I would think so, I mean if you have a large number of substitutions to be made in a lengthy piece of text, it seems pretty inefficient and silly to go through the entire text for each individual substitution.

  • Locked thread