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

Discussion in 'Perl Misc' started by Wes Groleau, Feb 5, 2006.

  1. Wes Groleau

    Wes Groleau Guest

    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
    Wes Groleau, Feb 5, 2006
    #1
    1. Advertising

  2. Wes Groleau wrote:
    > 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.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Feb 5, 2006
    #2
    1. Advertising

  3. Wes Groleau

    Wes Groleau Guest

    Gunnar Hjalmarsson wrote:
    > Wes Groleau wrote:
    >
    >> 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
    Wes Groleau, Feb 5, 2006
    #3
  4. Wes Groleau

    Wes Groleau Guest

    Abigail wrote:
    > Wes Groleau () 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
    Wes Groleau, Feb 5, 2006
    #4
  5. Wes Groleau

    Joe Smith Guest

    Wes Groleau wrote:
    > dbmopen (%DataBase, $GEDCOM . ".DB", 0644)
    > %Params = &read_params;


    Have you considered converting to perl5 syntax?
    Joe Smith, Feb 6, 2006
    #5
  6. Wes Groleau <> wrote:

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



    What was wrong with the original CGI query string parser?


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Feb 6, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Zimmerman
    Replies:
    4
    Views:
    331
    Mark Thornton
    Jan 31, 2004
  2. Jay Zimmerman
    Replies:
    0
    Views:
    360
    Jay Zimmerman
    Mar 4, 2004
  3. sputnik
    Replies:
    9
    Views:
    532
    Augustus
    Jul 6, 2003
  4. Guy
    Replies:
    2
    Views:
    178
    Dr John Stockton
    Dec 5, 2003
  5. johannes falcone

    is agile scrum stuff just to make people mad?

    johannes falcone, May 15, 2013, in forum: Perl Misc
    Replies:
    0
    Views:
    156
    johannes falcone
    May 15, 2013
Loading...

Share This Page