I've encountered a funky problem while testing a simple database access program written in Visual Basic. No I'm just kidding, it's Perl of course! Listen here's the story in brief. I have a Perl cgi script take registered user's names and emails into a database hash. No problem.

Just this morning, to test things, I whipped up a quick and dirty just to see who was currently in the database:
my (%MEMBERS, $member); dbmopen(%MEMBERS, "/httpd/userDBASE/contact", undef) or die "Couldn't open DBASE: $!\n"; for $member(sort keys %MEMBERS) { print "$member ---> $MEMBERS{$member}\n"; } #dmbclose(%MEMBERS);
I know your first complaint is going to be concerning my use of dbmopen (which is deprecated), but the "Llama" tells me to do so, and I follow. Running this script, I do get the output I want, however I get this message:
Use of uninitialized value in subroutine entry at /usr/lib/perl5/5.8.0 +/i686-linux/DB_File.pm line 259.
Yes, I have opened the .pm file and looked at, but the values on 259 are infact initialized? From .pm file:
sub tie_hash_or_array { my (@arg) = @_ ; my $tieHASH = ( (caller(1))[3] =~ /TIEHASH/ ) ; $arg[4] = tied %{ $arg[4] } if @arg >= 5 && ref $arg[4] && $arg[4] =~ /=HASH/ && tied %{ $ +arg[4] } ; # make recno in Berkeley DB version 2 work like recno in version 1 +. if ($db_version > 1 and defined $arg[4] and $arg[4] =~ /RECNO/ and $arg[1] and ! -e $arg[1]) { open( FH, ">$arg[1]") or return undef ; close FH ; chmod $arg[3] ? $arg[3] : 0666 , $arg[1] ; } DoTie_($tieHASH, @arg) ; }
line 259 is that DoTie_ ....
Any thoughts from my fellow monks would hugely ease my troubled mind. I hope this *.pm file doesn't require an exorcism ceremony!

Thank you kindly,
John

update (broquaint): $subject =~ s/Berkley/Berkeley/


In reply to Berkeley DB Funkiness by lacertus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.