Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: Getting err...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 10 Topic 10995 of 11532
Post > Topic >>

Re: Getting error - Global signal requires explicit package name

by stpra123@[EMAIL PROTECTED] (Hotkitty) Apr 28, 2008 at 05:49 PM

On Apr 28, 8:43=A0am, rob.di...@[EMAIL PROTECTED]
 (Rob Dixon) wrote:
> hotkitty wrote:
> > I'm trying to extract links from a website but get the following
> > error:
>
> > Global symbol "%Config" requires explicit package name at C:/Perl/lib/
> > Errno.pm l
> > ine 11.
> > Global symbol "%Config" requires explicit package name at C:/Perl/lib/
> > Errno.pm l
> > ine 11.
> > Global symbol "%Config" requires explicit package name at C:/Perl/lib/
> > Errno.pm l
> > ine 13.
> > Global symbol "%Config" requires explicit package name at C:/Perl/lib/
> > Errno.pm l
> > ine 13.
> > BEGIN not safe after errors--compilation aborted at C:/Perl/lib/
> > Errno.pm line 12
> > 9.
> > Compilation failed in require at C:/Perl/lib/IO/Socket.pm line 17.
> > BEGIN failed--compilation aborted at C:/Perl/lib/IO/Socket.pm line 17.
> > Compilation failed in require at C:/Perl/site/lib/LWP/Simple.pm line
> > 158.
>
> > What am I doing wrong? Here's the script (which I got from a YouTube
> > video...it seemed to work for him):
> > Thanks in advance!
>
> > #!/usr/bin/perl
> > print "Content-type: text/html\n\n";
>
> > use LWP::Simple;
> > require HTML::Parser;
> > require HTML::LinkExtor;
> > require strict;
> > use warnings;
>
> > $Domain =3D "ageofempires.co.nz";
> > $URL =3D get("http://www.ageofempires.co.nz");
>
> > mkdir "$Domain";
>
> > $LinkExtor =3D HTML::LinkExtor->new(\&links);
> > $LinkExtor->parse($URL);
>
> > sub links
> > {
> > =A0 =A0($tag, %links) =3D @[EMAIL PROTECTED]
> > =A0 =A0if ($tag =3D "a href" &&
> > =A0 =A0 =A0 =A0 =A0 =A0$links{href} =3D~ "$Domain") {
> > =A0 =A0$url =3D $links{href};
> > =A0 =A0$file =3D $url;
> > =A0 =A0$file =3D~ s/http:\/\/www\.//;
> > =A0 =A0$file =3D~ s/http:\/\///g;
> > =A0 =A0$file =3D~ tr/\//-/;
> > =A0 =A0mirror ($url, "$Domain/$file.html");
> > =A0 =A0print "Making $file.html\n";
>
> > =A0 =A0 }
> > }
>
> > $url =3D "http://$Domain";
> > =A0 =A0$file =3D $url;
> > =A0 =A0$file =3D~ s/http:\/\/www\.//;
> > =A0 =A0$file =3D~ s/http:\/\///g;
> > =A0 =A0$file =3D~ tr/\//-/;
> > =A0 =A0mirror ($url, "$Domain/$file.html");
> > =A0 =A0print "Making $file.html\n";
>
> > exit;
>
> You have a very odd Perl program there, but it still looks like it
should =
work. The errors you are getting show that Perl hasn't been installed
proper=
ly, as the Errno module is failing to load Config correctly, which is set
up=
 by the installation process. Try this command line
>
> =A0 perl -MErrno -e ""
>
> and I expect you will get the same error, and if so you should arrange
to =
reinstall Perl. If not then I will have to think again!
>
> HTH,
>
> Rob- Hide quoted text -
>
> - Show quoted text -

I've fixed the issue by reinstalling PERL. However, I am now getting
the error message saying: Use of uninitialized value in pattern match
(m//) at cctest.pl line 26.
(Line 26 is "if ($tag =3D "a href" && "
 




 10 Posts in Topic:
Getting error - Global signal requires explicit package name
stpra123@[EMAIL PROTECTED  2008-04-26 21:11:39 
Re: Getting error - Global signal requires explicit package name
peng.kyo@[EMAIL PROTECTED  2008-04-27 22:20:08 
Re: Getting error - Global signal requires explicit package name
noreply@[EMAIL PROTECTED]  2008-04-27 18:23:52 
Re: Getting error - Global signal requires explicit package name
noreply@[EMAIL PROTECTED]  2008-04-27 18:24:01 
Re: Getting error - Global signal requires explicit package name
noreply@[EMAIL PROTECTED]  2008-04-28 00:50:00 
Re: Getting error - Global signal requires explicit package name
rob.dixon@[EMAIL PROTECTE  2008-04-28 13:43:37 
Re: Getting error - Global signal requires explicit package name
stpra123@[EMAIL PROTECTED  2008-04-28 16:14:46 
Re: Getting error - Global signal requires explicit package name
stpra123@[EMAIL PROTECTED  2008-04-28 17:49:43 
Re: Getting error - Global signal requires explicit package name
noreply@[EMAIL PROTECTED]  2008-04-29 14:40:16 
Re: Getting error - Global signal requires explicit package name
stpra123@[EMAIL PROTECTED  2008-04-30 20:41:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 6:15:04 CDT 2008.