Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: WWW::Mechanize - Could not connect to a server

by marto (Chancellor)
on Mar 21, 2007 at 09:07 UTC ( #605800=note: print w/ replies, xml ) Need Help??


in reply to Re^2: WWW::Mechanize - Could not connect to a server
in thread WWW::Mechanize - Could not connect to a server

If you had read the Documentation (which was pointed out to you by chargrill in the first reply to this thread) you would see that you have $m->http_proxy rather than $m->proxy. Again, if you are not sure about something why not read the documentation, it does not take that long does it?

As a side note you can also use can to find out if a Method exists within an invocant:

#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); if ($mech->can("http_proxy")){ print "Mech can http_proxy\n"; }else{ print "Mech can't http_proxy\n"; } if ($mech->can("proxy")){ print "Mech can proxy\n"; }else{ print "Mech can't proxy\n"; }

Hope this helps

Martin


Comment on Re^3: WWW::Mechanize - Could not connect to a server
Select or Download Code
Re^4: WWW::Mechanize - Could not connect to a server
by Preceptor (Chaplain) on Mar 21, 2007 at 09:57 UTC
    To be fair, I also hadn't done an RTFM before posting, which is why I commented on the error. Then again, I'm not the one having problems with my code :)
      No harm done I guess, they would not sell pencils with erasers at one end if nobody ever made a mistake :) When possible I try and test the code I post to make sure that it works as I claim it will.

      Cheers

      Martin

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://605800]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2014-07-30 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (240 votes), past polls