C:\cygwin64\home\Fred\pages2\hunt>perl cpan10.pl HTML::Display C:\cygwin64\home\Fred\pages2\hunt>perl cpan10.pl HTML::Displayz C:\cygwin64\home\Fred\pages2\hunt>type cpan10.pl #! /usr/bin/perl use warnings; use strict; # work out the name of the module we're looking for my $module_name = $ARGV[0] or die "Must specify module name on command line"; # create a new browser use WWW::Mechanize; my $browser = WWW::Mechanize->new(); # tell it to get the main page $browser->get("http://search.cpan.org/"); # okay, fill in the box with the name of the # module we want to look up $browser->form_number(1); $browser->field( "query", $module_name ); $browser->click(); my $link = $browser->find_link( text_regex => qr{$module_name} ); # make sure $link is defined if ( defined $link ) { my $success2 = $browser->follow_link( url => $link->url ); my $url = $browser->uri; system( 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', $url ); } else { $browser->back; $browser->submit_form( form_number => 1, fields => { query => $module_name, mode => 'module', }, ); my $url = $browser->uri; system( 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', $url ); }