I get the error Undefined Subroutine &main::get called at Webcrawler.pl line 38, <STDIN> line 1. The code is below:
#!/usr/bin/perl use strict; #Module used to go through the web pages, Can extract links, save them + and also strip the HTML of its contents use WWW::Mechanize; use HTML::TreeBuilder; print "WEB CRAWLER AND HTML EXTRACTOR \n"; print "Please input the URL of the site to be searched \n"; print "Please use a full URL (eg. http://www.dcs.shef.ac.uk/) \n"; #Create an instance of the webcrawler my $webcrawler = WWW::Mechanize->new(); my $url_name = <STDIN>; # The user inputs the URL to be searched #Grab the contents of the URL given by the user $webcrawler = get($url_name);
There is more code in the program but i don't think it matters. Line 38 is the $webcrawler = get($url_name); line. Also, the <STDIN> is not on line 1 which buffles me too, i have quite a few comments written at the start and the my $url_name = <STDIN>; bit is line 35. I thought the problem here was because i didn't have installed the LWP::Simple module but i do have it after all. Any ideas?Thanks
In reply to Subroutine &main::get error by lampros21_7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |