Subject: | Data::Phrasebook::Generic arg handling to new() |
Hi Barbie,
In the Data::Phrasebook::Generic (v0.25) docs it says that for arguments
to new(), "Each value in the hash is given as an argument to a method
of the same name as the key."
Except I don't think this is happening, the hash was just being blessed.
One side-effect was that according to the Data::Phrasebook docs the dict
argument to new should accept either a scalar or an array ref. If a
scalar is stored directly and then retrieved via the dict() method, perl
dies as it tries to treat the value as an array ref.
The patch at the URL below makes the behaviour of
Data::Phrasebook::Generic and Data::Phrasebook the same as that
described in the documentation. I have included a test case for the
scalar dict argument problem I describe above (which fails in 0.25).
http://users.ox.ac.uk/~oliver/data/files/DP-generic-argsfix.diff
Oh, one other thing... the Data::Phrasebook::Generic docs also talk
about an init() routine in the source, but I can't seem to find that.
Perhaps that missing routine is something to do with this same bug?
regards,
oliver.