Re: file.db VS filedb
- From: noreply@xxxxxxxxx (Gunnar Hjalmarsson)
- Date: Tue, 29 Jan 2008 07:14:23 +0100
MK wrote:
you know gunnar i would swear on my mothers grave that i tried using both "" and '' in this and it still would not work, otherwise i really really really would not have cried wolf...but in all honesty it does work now, so there's egg on my face
Okay... ;-)
however, my connection of "dbmopen" with "DB_File" is straight out of the 1st Perl Cookbook, but "tie" from the DB_File man doesn't seem much different, nb. they both produce
Global symbol "%email" requires explicit package name at /usr/local/bin/AddressBook line 6.
even with
tie %email, "DB_File", 'email.db';
as long as use warnings/use strict is enabled (otherwise it's fine).
"use strict;" means that variables should be declared, so
tie my %email, "DB_File", 'email.db';
--------^^
To anyone's knowledge is there somewhere/one who has connected these strict warning messages to specific meanings in context? (they would seem very useful if that is the case, otherwise i cannot imagine what "requires explicit package name" could mean beyond the supplied "DB_File")
Literally it suggests this:
tie %main::email, "DB_File", 'email.db';
---------^^^^^^
It's not the best worded error message in Perl...
Suggested reading: http://perl.plover.com/FAQs/Namespaces.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- References:
- Re: file.db VS filedb
- From: Gunnar Hjalmarsson
- Re: file.db VS filedb
- From: Mk
- Re: file.db VS filedb
- Prev by Date: Re: Process Directory and subdirectories Recursively
- Next by Date: Re: How to avoid this greedy match?
- Previous by thread: Re: file.db VS filedb
- Next by thread: How to match a token not be quoted?
- Index(es):