Re: explicit package name

2011-10-03 Thread Chris Stinemetz
> > You have correctly declared the variable $guess, but you are using > $quess here, which doesn't exist. That is the sort of thing 'use strict' > is good at finding for you! > Oh my goodness! Maybe that is a sign it is time to call it a night! Thanks all! Not sure why I couldn't see that. Chri

Re: explicit package name

2011-10-03 Thread Rob Dixon
On 04/10/2011 03:59, Chris Stinemetz wrote: Can someone tell me why I am getting the following error? Global symbol "$quess" requires explicit package name at ./ex10-1.pl line 18. Execution of ./ex10-1.pl aborted due to compilation errors. I declare $guess inside the while loop. Shou

Re: explicit package name

2011-10-03 Thread John W. Krahn
Chris Stinemetz wrote: Can someone tell me why I am getting the following error? Global symbol "$quess" requires explicit package name at ./ex10-1.pl line 18. Execution of ./ex10-1.pl aborted due to compilation errors. I declare $guess inside the while loop. Shouldn't that suffi

explicit package name

2011-10-03 Thread Chris Stinemetz
Can someone tell me why I am getting the following error? Global symbol "$quess" requires explicit package name at ./ex10-1.pl line 18. Execution of ./ex10-1.pl aborted due to compilation errors. I declare $guess inside the while loop. Shouldn't that suffice for the rest of the sc

Re: Use Strict, Perl 5.10 and Global Symbol requires explicit package name

2009-09-29 Thread Soham Das
Shit!! Thanks, How asinine of me. From: Алексеев Александр To: Soham Das Cc: beginners@perl.org Sent: Tuesday, 29 September, 2009 2:52:26 PM Subject: Re: Use Strict, Perl 5.10 and Global Symbol requires explicit package name @dates and %dates are two

Re: Use Strict, Perl 5.10 and Global Symbol requires explicit package name

2009-09-29 Thread Алексеев Александр
Why does, Line a throw a compiler error, "Global Symbol @dates requires explicit package name" while Line b throws the same error if I do just the opposite. Change the curly to sqaures. Btw, I can't do away with use strict directive. Moreover, is there a better, more elegant way to

Use Strict, Perl 5.10 and Global Symbol requires explicit package name

2009-09-29 Thread Soham Das
ne a, I have changed from square brackets to curly brackets for the hash work. The exactly same thing, is also done in Line #b. Why does, Line a throw a compiler error, "Global Symbol @dates requires explicit package name" while Line b throws the same error if I do just the op

Re: Getting error - Global signal requires explicit package name

2008-05-01 Thread hotkitty
On Apr 29, 8:40 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > hotkitty wrote: > > 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 = "a href"

Re: Getting error - Global signal requires explicit package name

2008-04-29 Thread Gunnar Hjalmarsson
hotkitty wrote: 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 = "a href" && " I already addressed that issue. http://www.mail-archive.com/beginners%4

Re: Getting error - Global signal requires explicit package name

2008-04-29 Thread hotkitty
On Apr 28, 8:43 am, [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 >

Re: Getting error - Global signal requires explicit package name

2008-04-29 Thread hotkitty
Thanks for the help. It was an install issue. I reinstalled Perl and now script works fine. Thanks again for the responses! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Getting error - Global signal requires explicit package name

2008-04-28 Thread Rob Dixon
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 a

Re: Getting error - Global signal requires explicit package name

2008-04-27 Thread Gunnar Hjalmarsson
Gunnar Hjalmarsson 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:/Pe

Re: Getting error - Global signal requires explicit package name

2008-04-27 Thread Gunnar Hjalmarsson
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 1

Re: Getting error - Global signal requires explicit package name

2008-04-27 Thread Gunnar Hjalmarsson
J. Peng wrote: On Sun, Apr 27, 2008 at 12:11 PM, hotkitty <[EMAIL PROTECTED]> wrote: Here's the script (which I got from a YouTube video...it seemed to work for him): No. If this is the original script, it can't work even for the author. You 'require strict' and 'use warnings' but for all va

Re: Getting error - Global signal requires explicit package name

2008-04-27 Thread J. Peng
On Sun, Apr 27, 2008 at 12:11 PM, hotkitty <[EMAIL PROTECTED]> 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 > > What am I

Getting error - Global signal requires explicit package name

2008-04-27 Thread hotkitty
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 &q

Re: package name

2005-12-13 Thread John Doe
Brent Clark am Dienstag, 13. Dezember 2005 13.25: > Hi all Hi Brent > For some reason I keep geting this message. > > Global symbol "$arguments" requires explicit package name at sql_handler.pm > line 37. Global symbol "$arguments" requires explicit packa

package name

2005-12-13 Thread Brent Clark
Hi all For some reason I keep geting this message. Global symbol "$arguments" requires explicit package name at sql_handler.pm line 37. Global symbol "$arguments" requires explicit package name at sql_handler.pm line 40. Global symbol "$table" requires explicit

Re: Why "Global symbol require explicit package name"

2003-06-28 Thread Paul Johnson
On Sat, Jun 28, 2003 at 03:51:49PM +0200, Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, John W. Krahn wrote: > [...] > > Perhaps this article may help you understand. > > > > http://perl.plover.com/FAQs/Namespaces.html > > I've read this before (but it pays to reread it) and this time I

Re: Why "Global symbol require explicit package name"

2003-06-28 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, John W. Krahn wrote: [...] > Perhaps this article may help you understand. > > http://perl.plover.com/FAQs/Namespaces.html I've read this before (but it pays to reread it) and this time I also read the "Seven Useful Uses of local". One thing MJD demonstrates is a

Re: Why "Global symbol require explicit package name"

2003-06-27 Thread John W. Krahn
looks something like thing: > Use strict; > $strg = "A string"; > $strg2 = "a second string"; > > I get a warning: > "Global symbol require explicit package name." The warning is telling you to add the package name to the variable which in this case

Re: Why "Global symbol require explicit package name"

2003-06-27 Thread George Schlossnagle
ot;A string"; $strg2 = "a second string"; I get a warning: "Global symbol require explicit package name." unless I declare the variables like: my $strg = "A string"; my $strg2 = "a second string"; Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Why "Global symbol require explicit package name"

2003-06-27 Thread Babale Fongo
Hello guy! I would like to know why I need to declare global variables with "my". My script looks something like thing: Use strict; $strg = "A string"; $strg2 = "a second string"; I get a warning: "Global symbol require explicit package name." unless

RE: Current package name

2003-01-21 Thread Bob Showalter
Beau E. Cox wrote: > Hi - > > How do I get the current package name? For example, > if I have a module that starts with: > > package Beau::Cool::Stuff; > ... > > and I want to give an error (die) later in this module: > > ... > die "invalid stuf

RE: Current package name

2003-01-21 Thread Beau E. Cox
__THANKS__ ;) > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 21, 2003 8:27 AM > To: Beau E. Cox; 'Beginners > Subject: RE: Current package name > > > __PACKAGE__ > > 3rd Camel, page 68, Li

Re: Current package name

2003-01-21 Thread Janek Schleicher
On Tue, 21 Jan 2003 08:15:09 +, Beau E. Cox wrote: > How do I get the current package name? For example, > if I have a module that starts with: It's in __PACKAGE__ Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Current package name

2003-01-21 Thread wiggins
__PACKAGE__ 3rd Camel, page 68, Literals http://danconia.org On Tue, 21 Jan 2003 08:15:09 -1000, "Beau E. Cox" <[EMAIL PROTECTED]> wrote: > Hi - > > How do I get the current package name? For example, > if I ha

Current package name

2003-01-21 Thread Beau E. Cox
Hi - How do I get the current package name? For example, if I have a module that starts with: package Beau::Cool::Stuff; ... and I want to give an error (die) later in this module: ... die "invalid stuff passed to Beau::Cool::Stuff::function\n"; ... where is the 'package name

RE: explicit package name errors

2002-11-06 Thread ss004b3324
Hi Shaunn, > my $sql="SELECT > name, > tbname > from sysibm.syscolumns > where tbname = 'local_table'; --^ You forgot the closing double quotes. You either need to have the query all on one line or concatenate it: my $sql = ( "SELECT name, tbname FROM sysibm.syscolumn

Re: explicit package name errors

2002-11-06 Thread Paul Johnson
Johnson, Shaunn said: > Howdy: > > Can someone tell me why I keep getting the errors: > [snip error] > D:\PERL\BIN\MY_SCPTS>db2_test1.pl > syntax error at D:\PERL\BIN\MY_SCPTS\db2_test1.pl line 35, near "my" > Global symbol "$sth" requires explicit

explicit package name errors

2002-11-06 Thread Johnson, Shaunn
Howdy: Can someone tell me why I keep getting the errors: [snip error] D:\PERL\BIN\MY_SCPTS>db2_test1.pl syntax error at D:\PERL\BIN\MY_SCPTS\db2_test1.pl line 35, near "my" Global symbol "$sth" requires explicit package name at D:\PERL\BIN\MY_SCPTS\db2_ test1.pl line

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
Jeff 'japhy' Pinyan wrote: > %Foo::Bar::Constants::. But anyway, here's the trick I'd use: > > *short:: = *Foo::Bar::Constants::; > print $short::name; # $Foo::Bar::Constants::name ah thanks, this package aliasing thingie is what i had been trying to accomplish several hours earlier, to

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
Jeff 'japhy' Pinyan wrote: > It's important to know that those "constants" aren't as efficient as their > non-method syntax cousins: > > package FOO; > use constant BAR => 10; > > package main; > print FOO::BAR; # at compile-time, Perl makes that 'print 10' > print FOO->BAR;

Re: package name alias (for shorter variable name)

2002-10-04 Thread Jeff 'japhy' Pinyan
On Oct 5, David Garamond said: >James Edward Gray II wrote: >> Building on this though, if you made the constants module, couldn't you >> make them subs? I believe this is even how the use constant pragma >> functions. Heck make it an object oriented module with static methods >> and it's even

Re: package name alias (for shorter variable name)

2002-10-04 Thread Jeff 'japhy' Pinyan
On Oct 5, David Garamond said: >indeed. i still want to name my package Foo::Bar::Constants. the 'X' (or >let's name it 'tmp') is just a temporary prefix to help ease my weary >typing hands. in python i can do something like this: > > import Foo.Bar.Constants > print Foo.Bar.Constants.alice >

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
Bob Showalter wrote: >use Foo::Bar::Constants (); >{ package X; Foo::Bar::Constants->import } >print $X::alice->{name};# prints "Alice" > > Here your using the Exporter functionality, but exporting symbols into the > "X" namespace instead of your current namespace. The empty paren

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
James Edward Gray II wrote: > Building on this though, if you made the constants module, couldn't you > make them subs? I believe this is even how the use constant pragma > functions. Heck make it an object oriented module with static methods > and it's even designed well. Just a thought. g

RE: package name alias (for shorter variable name)

2002-10-04 Thread Bob Showalter
> -Original Message- > From: David Garamond [mailto:[EMAIL PROTECTED]] > Sent: Friday, October 04, 2002 3:17 PM > To: Bob Showalter > Cc: [EMAIL PROTECTED] > Subject: Re: package name alias (for shorter variable name) > > > thanks for the answer, bo

Re: package name alias (for shorter variable name)

2002-10-04 Thread James Edward Gray II
n designed well. Just a thought. James Gray On Friday, October 4, 2002, at 03:17 PM, David Garamond wrote: > James Edward Gray II wrote: >> I haven't tested it, but I'm quite sure: >> my $p = 'Long::Package::Name'; >> $p->constant; >> ...works

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
James Edward Gray II wrote: > I haven't tested it, but I'm quite sure: > > my $p = 'Long::Package::Name'; > $p->constant; > > ...works as expected. If memory serves this is even allowed under the > strict pragma. If not though, you could always loc

RE: package name alias (for shorter variable name)

2002-10-04 Thread Timothy Johnson
PROTECTED]] Sent: Friday, October 04, 2002 12:51 PM To: David Garamond Cc: Timothy Johnson; [EMAIL PROTECTED] Subject: Re: package name alias (for shorter variable name) I haven't tested it, but I'm quite sure: my $p = 'Long::Package::Name'; $p->constant; works as expected. I

Re: package name alias (for shorter variable name)

2002-10-04 Thread James Edward Gray II
I haven't tested it, but I'm quite sure: my $p = 'Long::Package::Name'; $p->constant; works as expected. If memory serves this is even allowed under the strict pragma. If not though, you could always localize a block with no strict 'refs' where yo

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
Timothy Johnson wrote: > I'm not sure if this is a GOOD idea, but I THINK you can actually get away > with something like this: In your module, insert a shorter package name, > but keep the module in the same place. So: > > package Foo::Bar::Constants; >

Re: package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
thanks for the answer, bob. Bob Showalter wrote: > There's nothing that says the file Foo/Bar/Constants.pm must have a "package > Foo::Bar::Constants" declaration. true, and i've realized that. i come from a python background and by contrast, in python, filename and directory name dictate the

RE: package name alias (for shorter variable name)

2002-10-04 Thread Bob Showalter
> -Original Message- > From: David Garamond [mailto:[EMAIL PROTECTED]] > Sent: Friday, October 04, 2002 2:05 PM > To: [EMAIL PROTECTED] > Subject: package name alias (for shorter variable name) > > > i have several "constants" in a package: &

RE: package name alias (for shorter variable name)

2002-10-04 Thread Timothy Johnson
I'm not sure if this is a GOOD idea, but I THINK you can actually get away with something like this: In your module, insert a shorter package name, but keep the module in the same place. So: package Foo::Bar::Constants; #do stuff here package My

package name alias (for shorter variable name)

2002-10-04 Thread David Garamond
$devon = {name=>"Devon E.", low=>1, high=>29}; and i want to use them in another package: package main; require Foo::Bar::Constants; use Foo::Bar::Functions; add_foo(\@a1, $Foo::Bar::Constants::alice, 1, 3); add_foo(\@a1, $Foo::Bar::Constants::bruce, 2, -