use warnings; use strict; use WWW::Mechanize; use HTML::TreeBuilder; my $webcrawler = WWW::Mechanize->new(); my $page = $webcrawler->get ('http://perlmonks.org/?node_id=479598'); my $tree = HTML::TreeBuilder->new_from_content ($page->as_string ()); print $tree->as_text (); #### Syntax error for WWW::MechanizeHTTP/1.1 200 OK Connection: close Date: Sat, 30 Jul 2005 13:24:01 GMT Server: Apache/1.3.27 Content-Type: text/html; charset=ISO-8859-1 Client-Date: Sat, 30 Jul 2005 13:24:02 GMT Client-Peer: 66.39.54.27:80 Client-Response-Num: 1 Client-Transfer-Encoding: chunked Link: ; /="/"; rel="stylesheet"; type="text/css" Link: ; /="/"; rel="stylesheet"; type="text/css" Link: ; /="/"; rel="icon" Title: Syntax error for WWW::Mechanize P is for Practical Perl Monks Syntax error for WWW::Mechanize by lampros21_7 | Log in | Create a new user | The Monastery Gates | Super Search | | Seekers of Perl Wisdom | Meditations | PerlMonks Discussion | Snippets | | Obfuscation | Reviews | Cool Uses For Perl | Perl News | Q&A | Tutorials | | Code | Poetry | Recently Active Threads | Newest Nodes | Offering Plate | on Jul 30, 2005 at 11:42 UTC ( #479598=perlquestion: print w/ replies, xml )Need Help?? lampros21_7 has asked for the wisdom of the Perl Monks concerning the following question: Hi, i have asked about another error message before but now i get a syntax error message about the last line of my code. It says "syntax error at WebCrawler.pl near $webcrawler(". It says in the documentation for WWW::Mechanize that i need the HTML::TreeBuilder but i have installed that so thats not the problem. The $stripped_html[$x] = $webcrawler( format => "text"); line is part of the module WWW::Mechanize.pmThanks our $webcrawler = WWW::Mechanize->new(); #Grab the contents of the URL given by the user our $webcrawler = get($url_name); # Put the links that exist in the HTML of the URL given by the user i +n an array our @website_links = $webcrawler->links($url_name); # The HTML is stripped off the contents and the text is stored in an +array of strings our $x = 0; my @stripped_html; $stripped_html[$x] = $webcrawler( format => "text"); comment on Syntax error for WWW::MechanizeSelect Code to DownloadDownload CodeRe: Syntax error for WWW::Mechanize by GrandFather on Jul 30, 2005 at 11:56 UTCThere looks to be a subroutine name missing there.Perl is Huffman encoded by design. [reply]Re^2: Syntax error for WWW::Mechanize by lampros21_7 on Jul 30, 2005 at 12:58 UTCWhat subroutine is missing? I am basically trying to save as a string the non-HTML content of a website using that part od the WWW::Mechanize code. [reply] Back to Seekers of Perl Wisdom Login:Passwordremember mepassword reminderCreate A New User Node Status node historyNode Type: perlquestion [id://479598]Approved by GrandFatherhelp Chatterbox http://www.nasa. gov/images/ content/123677main _8M2C2673_hires. jpg: cool picture of space shuttleHow do I use this? | Other CB clients Other Users Others riffling the monastery: (16)theorbtwo rinceWind atcroft castaway wfsp jhourcle Not_a_Number Arunbear GrandFather jk2addict bpphillips cazz cyclist38 siracusa prlmnks.org Bud Man As of 2005-07-30 13:21 GMT Sections The Monastery GatesSeekers of Perl WisdomMeditationsPerlMonks DiscussionCategorized Q&AObfuscated CodePerl PoetryCool Uses for PerlSnippets SectionCode CatacombsPerl News Information PerlMonks FAQGuide to the MonasteryVoting/Experience SystemTutorialsReviewsLibraryPerl FAQsOutside Links Find Nodes Nodes You WroteSuper SearchPerl Monks User SearchNewest NodesRecently Active ThreadsSelected Best NodesBest NodesWorst NodesSaints in our Book Leftovers The St. Larry Wall ShrineOffering PlateAwardsCraftQuestsEditor RequestsBuy PerlMonks GearPerl Monks MerchandiseRandom Node Voting Booth Most poll options are...Too broad Not broad enough Too obscure Not obscure enough Gratuitously funny Not funny enough Missing my favourite foo Just right In English [results][172 votes] [past polls] This page brought to you by the kind folks at The Everything Development Company and maintained by Tim Vroom. Perl Monks was recently assimilated by The Perl Foundation. Beefy Boxes and Bandwidth Generously Provided by pair Networks