Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Cal Dershowitz
February 2, 2013, 7:16 am
rate this thread
have. I found this one today and was able to adapt it (slightly) to
actually make it work. I think of how long it takes me to do this with
GUI events, and this is so much better.
$ ./cpan1.pl HTML::Form
$ cat cpan1.pl
# turn on perl's safety features
# work out the name of the module we're looking for
my $module_name = $ARGV
or die "Must specify module name on command line";
# create a new browser
my $browser = WWW::Mechanize->new();
# tell it to get the main page
# okay, fill in the box with the name of the
# module we want to look up
$browser->field( "query", $module_name );
# click on the link that matches the module name
$browser->follow_link( text => $module_name );
my $url = $browser->uri;
# launch a browser...
system( 'firefox', $url );
That this fires up firefox at the end makes it a great tool. I'm
struggling now with the referencing in the object model, but I'm wearing
it down with repetition.
I'd love to see any examples others may have.
- » OT: Any IT related events in the NYC/Boston area this year???
- — Previous thread in » PERL Discussions