in reply to Re^2: LWP::Simple... Enough for Site Query & Data Download?
in thread LWP::Simple... Enough for Site Query & Data Download?

Go through the docs a little more carefully. You're printing the mech object, not the forms. Try this instead-

use WWW::Mechanize; use YAML (); my $mech = WWW::Mechanize->new(); $mech->get( "http://bub2.meteo.psu.edu/wxstn/wxstn.htm" ); print YAML::Dump [ $mech->forms ];

Next stop: the docs for HTML::Form.

Replies are listed 'Best First'.
Re^4: LWP::Simple... Enough for Site Query & Data Download?
by cheech (Beadle) on Jun 16, 2009 at 21:26 UTC
    Unfortunately I get the error,
    C:\Perl\scripts>perl -wc foo.pl Can't locate YAML.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at foo.pl line 6. BEGIN failed--compilation aborted at foo.pl line 6."
    when I run this code..?
        This command returned "Can't find any package that provides YAML."

        Since I'm using Windows, I just opened the package manager and installed the very last package, "YAML - libYAML."

        This was successful, but the same error msg is still received when I try to run my code..?

      Sorry about that. I forget it's not a core module. Try this.

      use WWW::Mechanize; use Data::Dumper; $Data::Dumper::Terse = 1; my $mech = WWW::Mechanize->new(); $mech->get( "http://bub2.meteo.psu.edu/wxstn/wxstn.htm" ); print Dumper($mech->forms);