Is this DBM::Deep behavior, or something with tie/bless?by romandas (Pilgrim)
|on Jan 29, 2008 at 22:52 UTC||Need Help??|
romandas has asked for the
wisdom of the Perl Monks concerning the following question:
Hello all, I am a relatively inexperienced Perl programmer (still working my way through Intermediate Perl).
While working on using DBM::Deep, I noticed some behavior I cannot explain.
I am using DBM::Deep 0.983 because there are no later versions available from ActiveState. Here is my code:
My questions, as shown in the comments, are:
1) Why does the hash reference, which prints clearly on its own, show a connection to the database when dereferenced and stored in the original array?
2) Why does using a new array, or redeclaring the array using 'my' fix this? I assume the answer is the same for both new and 'my' but do not understand either way.
Note: Running this on my Linux machine instead of my Windows machine does not yield a fix using 'my' again, but instead gives a warning of '"my" variable @array masks earlier declaration in same scope at test_dbm.pl line 30'. Of course, my Linux machine has DBM::Deep 1.0007 installed.
Any enlightenment you can provide would be most appreciated.