#! /usr/bin/perl use warnings; use strict; use 5.010; use WWW::Mechanize; my $url = 'https://www.huntington.com/'; my $mech = WWW::Mechanize->new; $mech->get($url); my $c = $mech->content; say "c is $c"; my $url2 = 'https://berniesanders.com/issues/racial-justice/'; my $mech2 = WWW::Mechanize->new; $mech2->get($url2); my $c2 = $mech2->content; say "c2 is $c2"; #### #! /usr/bin/perl use warnings; use strict; use 5.010; use LWP::UserAgent; use HTML::Display; my $url = 'https://www.huntington.com/'; my $ua = LWP::UserAgent->new; $ua->agent( 'Windows Mozilla/5.0'); my $response = $ua->get($url); my $content = $response->content; $ENV{'PERL_HTML_DISPLAY_COMMAND'}='run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" %s'; my $browser=HTML::Display->new(); if (defined($browser)) { $browser->display(html=>$content); } else { print("Unable to open browser: $@\n"); } #### #!/usr/bin/perl # turn on perl's safety features use strict; use warnings; # 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(); # click on the link that matches the module name $browser->follow_link( text_regex => $module_name ); my $url = $browser->uri; # launch a browser... system('galeon', $url); exit(0); #### #! /usr/bin/perl use warnings; use strict; use 5.010; my $url = 'https://www.youtube.com/watch?v=ju1IMxGSuNE'; system( 'run C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', $url ); exit(0); #### The filename, directory name, or volume label syntax is incorrect.