in reply to autotie in Attribute Handlers
Here is what is happening. Your argument list is always being turned into a reference to an array. If you process it that way in your tie implementation, it works just fine. If you don't, then you get your result.
Now if you look in the implementation, in import the variable $tiedata is defined in the following snippet:
Now that looks to me to be an error, if you had an array reference, then leave it alone, if you didn't then try to dereference it as an array reference? If you didn't have an array reference, what possible sense does it make to dereference it as one?if ($cmd =~ /^autotie((?:ref)?)$/) { my $tiedata = '($was_arrayref ? $data : @$data)'; $tiedata = ($1 ? '$ref, ' : '') . $tiedata; my $mapping = shift;
Well if you try switching which branch of the trinary operator the array dereference takes place in, that code reads much more sensibly, and your test works entirely as you expected it to. However if you do that, 2 tests in the test suite fail. So I suspect that this is a bug in the code which was enshrined in the tests.
But I can't be sure of that without asking TheDamian. (I sent him a message.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 1: autotie in Attribute Handlers
by TheDamian (Vicar) on Nov 04, 2001 at 03:27 UTC | |
by tilly (Archbishop) on Nov 04, 2001 at 04:27 UTC | |
by TheDamian (Vicar) on Nov 04, 2001 at 05:12 UTC |