On 12/12/06, Helliwell, Kim <[EMAIL PROTECTED]> wrote:
I think you need to do:
my %loginhash = {};
That's not right. {} is a hash ref, not a hash. It stands for a scalar value.
When you do that
my %h = {}
or, for the same result,
my %h = 1;
my %h = "abacate";
you end with a hash
update your address book and distribution lists
accordingly. Thank you.
-Original Message-
From: Dukelow, Don [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 12, 2006 8:23 AM
To: beginners@perl.org
Subject: declaring a zero size hash
I'm trying to declare a zero size hash so
On 12/12/06, Dukelow, Don <[EMAIL PROTECTED]> wrote:
I'm trying to declare a zero size hash so a sub function can populate it and
be see by all other sub's.
my %loginHash();
Maybe you mean this?
my %loginHash = ();
But every new variable (which is what 'my' is declaring) starts out
empty
On 12/12/06, Dukelow, Don <[EMAIL PROTECTED]> wrote:
I'm trying to declare a zero size hash so a sub function can populate it and
be see by all other sub's.
my %loginHash();
my %loginHash;
should be enough.
But the "use strict" doesn't like it.
It is not "use strict" that does not like i
Just write it like:
my %loginHash = ();
This should work.
-Original Message-
>From: "Dukelow, Don" <[EMAIL PROTECTED]>
>Sent: Dec 13, 2006 12:23 AM
>To: beginners@perl.org
>Subject: declaring a zero size hash
>
>I'm trying to declare a zero size
I'm trying to declare a zero size hash so a sub function can populate it and
be see by all other sub's.
my %loginHash();
But the "use strict" doesn't like it. All examples of making a hash
structure is hard coded in the program or is made reading from a file. When
I try to run the script all I