Subject: | version numeric/string confusion. |
Hello,
I was investigating a problem in which we couldn't get information
out of the cache. After some head banging and an excellent imitation of
a dog that just wouldn't give up on a bone... I found that there was
some a problem in how we had referenced the version string. Our package
defined $VERSION as such
package Foo;
$VERSION = "1.0";
---
The code called for
$data = $cache->get( id => 'blah', key => 'blah', version => 1.0 );
The problem occurs because the get call requests version 1.0 which
evaluates to 1; and the key join in sub _data_key
$namespace.$delimiter.$version.$delimiter.$key;
comes out as being
... "#1.0#" ...
while the above get call evaluates to
... "#1#" ...
I would like to suggest that you may want to "use version" as a way of
preventing anyone from making the same mistake I did. :)
http://search.cpan.org/~jpeacock/version-0.7203/lib/version.pod
This package will "normalize" a version string and prevent any
numeric/string oppsies.
If you have any questions please feel free to contact me.
Thank you!
-daniel (woof woof!)