>
> 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
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
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
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
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
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
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
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"
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
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
>
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/
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
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
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
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
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
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
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
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
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
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
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
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
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
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
__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
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]
__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
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
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
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
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
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
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;
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
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
>
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
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
> -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
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
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
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
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
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;
>
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
> -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:
&
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
$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, -
48 matches
Mail list logo