I just can't get this global/local/my stuff

W

Wes Groleau

my (%DataBase, $The_Key);

dbmopen (%DataBase, $GEDCOM . ".DB", 0644)
or die "dbmopen failed ($!) on $GEDCOM.DB\n";

my %Params = &read_params;
# read_params is reinvented CGI QUERY_STRING parser

my @Keys = split (/,/, $Params{"ID"});

foreach $The_Key ( @Keys )
{
print $Database{$The_Key};
}
-----

The print line gets:
Global symbol "%Database" requires explicit package name at ...

I have compared this version to the earlier version that was working
and can't see the difference (except for adding subs that have not yet
been called).

--
Wes Groleau

"A man with an experience is never
at the mercy of a man with an argument."
-- Ron Allen
 
G

Gunnar Hjalmarsson

Wes said:
my (%DataBase, $The_Key);

dbmopen (%DataBase, $GEDCOM . ".DB", 0644)
or die "dbmopen failed ($!) on $GEDCOM.DB\n";

my %Params = &read_params;
# read_params is reinvented CGI QUERY_STRING parser

my @Keys = split (/,/, $Params{"ID"});

foreach $The_Key ( @Keys )
{
print $Database{$The_Key};
}
-----

The print line gets:
Global symbol "%Database" requires explicit package name at ...

I have compared this version to the earlier version that was working
and can't see the difference (except for adding subs that have not yet
been called).

Perl is case sensitive.
 
W

Wes Groleau

Gunnar said:
Wes said:
my (%DataBase, $The_Key);

dbmopen (%DataBase, $GEDCOM . ".DB", 0644)
or die "dbmopen failed ($!) on $GEDCOM.DB\n";

[snip]
print $Database{$The_Key};

I have compared this version to the earlier version that was working
and can't see the difference (except for adding subs that have not yet
been called).

Perl is case sensitive.

:) That's what I get for giving it a stupid name in the first place.
While editing, I accidentally deleted the line and re-typed it.

thanks!

--
Wes Groleau
"Ideas are more powerful than guns,
We would not let our enemies have guns;
why should we let them have ideas?"
-- Jozef Stalin
 
W

Wes Groleau

Abigail said:
Wes Groleau ([email protected]) wrote on MMMMDXLI September
~~ my (%DataBase, $The_Key);
^ Uppercase B
~~ [snip]
~~ print $Database{$The_Key};
^ Lowercase b

Thanks !!
See earlier message for my embarrassed confession.

--
Wes Groleau

"A man with an experience is never
at the mercy of a man with an argument."
-- Ron Allen
 
T

Tad McClellan

Wes Groleau said:
my %Params = &read_params;
# read_params is reinvented CGI QUERY_STRING parser


What was wrong with the original CGI query string parser?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top