So, I've just started learning Perl, and I've decided to read up on some modules. I encountered WWW::Mechanize, which interests me, so I decided to try out a couple of basic tutorials. One of them is found here. I tried what seems a very basic case:
Strict pragma is not being used, so this should be fairly forgiving. The error message I get is:
So, it seems reasonable to make sure that the value $url is actually being properly assigned. I commented out the last 3 lines and added this after the $m assignment lines:
It printed "http://www.google.com" (without quotes) properly. To back this up, I explicitly stated "http://www.google.com" in the "get" portion, and got the same error. So, it appears that the problem is not with variable assignment. That suggests that perhaps the WWW::Mechanize module isn't installed. So, I did "perldoc perllocal" and got:
with the usual accompanying information. I did the installation through CPAN about an hour ago. It appears to be installed and available, and yet the script fails. Do I have to do anything to "initialize" the module, so to speak? If not, what in the world might be going wrong with this? Many thanks in advance.
Strict pragma is not being used, so this should be fairly forgiving. The error message I get is:
The error message is pretty telling. Line 4 is
, and somewhere in there is an undefined value. You've established that it ain't $url, so what's left?
The problem with the second example in the given tutorial is that it isn't runnable, unless you apply some common sense and re-use a line from the first example:
Include that line before you call any methods on $m (which is undefined otherwise), and you should be fine.
I am installing Oracle DBD to PERL 5.16.3 and during make test , I am running into this error :rm -f blib/arch/auto/DBD/Oracle/Oracle.so
LD_RUN_PATH="/opt/oracle/product/11.2.0/racdb11204/lib" gcc -m32 -shared -O2 -L/usr/local/lib -fstack-protector Oracle.o dbdimp.o oci8.o -o... (3 Replies)
Hello everyone,
I've got some problem intalling a perl module.
The installation is well done as you can see below.
gueg@ux31:~$ sudo apt-get install libwww-mechanize-perl
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état...... (4 Replies)
Hello,
Am very new to perl , please help me here !!
I need help in reading a URL from command line using PERL:: Mechanize and needs all the contents from the URL to get into a file.
below is the script which i have written so far ,
#!/usr/bin/perl
use LWP::UserAgent;
use... (2 Replies)
Hello, I am trying to get to learn WWW::Mechanize & have found alot of sample scripts (that dont work) so am wondering if anyone has any that do, I basically just learn from stripping current bits out seeing how they work etc.. etc.. -
if anyone can point me to somewhere that has a few good... (0 Replies)
Hi Everyone,
we have a shell script "DLP_recv.sh" that has below command which is supposed to return the number of active instances of itself, which means of there is no other instance then commad would return 1 (for the current instance). The problem is that it sometimes it returns 0 which is... (3 Replies)
We've been running perl scripts using the www::mechanize module on a linux box with no issues, however we just implemented the same scripts on an aix machine, aix 6.1, perl 5.8.8, and I am running into the issue with Content_Encoding: gzip in the returned html. I can't read it in that it is coming... (0 Replies)
what happened with www.caldera.com or www.sco.com?
i cant access the sites 10 days now.
I try from my home pc, from internet cafe,from my work.
Can you access these sites?
I live in Greece. (2 Replies)
OMGosh!!!
PERL OWZORZ ME!!!!!!!
ok ok let me take a deep breath.....
altho i have just started learning perl and scripting in perl. this is like the BOMB!!!.
you remember when you started shell scripting and you felt limitless. this is how i feel now. how could i have ever lived my life... (4 Replies)