Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

HTML::Form->parse() fails under 5.8.1

by dda (Friar)
on Mar 13, 2004 at 22:27 UTC ( [id://336422]=perlquestion: print w/replies, xml ) Need Help??

dda has asked for the wisdom of the Perl Monks concerning the following question:

Hi!

Here is the code which works under 5.6.0 and 5.8.0, but fails to find the form under 5.8.1:

#!/usr/bin/perl -w use strict; use HTML::Form; my $html = "<form></form>"; if (my $form = HTML::Form->parse($html, "localhost")) { print "Found!\n"; } else { print "Error!\n" };
Do you have an idea why does it happen? The version of HTML::Form is 0.03 on all servers which I tried...

--dda

Replies are listed 'Best First'.
Re: HTML::Form->parse() fails under 5.8.1
by dda (Friar) on Mar 14, 2004 at 09:12 UTC
    I've found the problem -- I upgraded my perl from 5.8.0 to 5.8.1 some time ago, and did not upgrade modules. As a result, PullParser.pm (and not only this module) was from the old version:
    [dda@dragon dda]$ locate PullParser /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/PullPars +er.pm
    After I've downloaded and installed newer version of HTML::Parser, I have two places where this file is located:
    [dda@dragon dda]$ locate PullParser.pm /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/HTML/PullParser +.pm /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/PullPars +er.pm
    Now my script works! But I wonder how should I process during perl upgrade? This is RedHat 9, and perl 5.8.0 was shipped with it, and 5.8.1 was installed from RPM later. I have a lot of other modules in 5.8.0 hierarchy, should I upgrade all of them too? And how?

    --dda

      Personally, I would leave the perl that came with my system alone and install a second perl parallel to it, but if RedHat distributes RPMs for upgrading, possibly they have tested them against their system utilities.

      The CPAN.pm module has a feature called "autobundle", that you can use to reinstall any modules that you want to transfer from the old installation to the new installation - if you still have the old perl (5.8.0) available and running.

      perl5.8.0 -MCPAN -eautobundle

      If you don't have your old perl anymore, you will have to do some shell/Perl trickery to get the interesting files out of /usr/perl/site/lib/5.8.0/ or wherever your Perl modules have been installed into:

      #!/bin/bash find /usr/perl/site/lib/5.8.0 -name '*.pm' | \ perl -pe 's!/!::!g; s!\.pm$!!'

      The resulting list should be a (overly big) list of all modules, and you can then let CPAN.pm loose on that list. Not all modules will be found, and you will install many modules more than one time, and the list won't be ordered according to the prerequisites, but at least in the end you should have all modules back.

      If you plan on upgrading perl, it's best to skip 5.8.1 and go directly to 5.8.2 (or later). 5.8.1 was not binary compatible with 5.8.0, the cause of your problems and the reason why 5.8.2 was released very soon after 5.8.1. (link: announcement of perl 5.8.2)
Re: HTML::Form->parse() fails under 5.8.1
by PodMaster (Abbot) on Mar 13, 2004 at 23:26 UTC
    Do you have an idea why does it happen?
    Try Devel::Trace and/or Devel::TraceCalls with both versions and compare (that's what I'd do if I had HTML::Form installed on 5.8.1).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://336422]
Approved by Theo
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-24 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found