in reply to Re: Re (tilly) 1: autotie in Attribute Handlers
in thread autotie in Attribute Handlers

That beta does fix that issue, but I consider its behaviour with the following line to be wrong:
my %hash : Test('one', 'two', 'three)');
Any human looking at this would say that the first closing paren is inside of a quoted string, and so this code is correct. But Attribute::Handlers disagrees. It is perfectly willing to stop at the first paren, and claim that the passed argument was the string:
"'one', 'two', 'three"
And therefore the following quote is interpreted differently than it should be.

I assume that this is due to the heuristics it uses to parse Perl. If it is hard to fix (as I assume) then it is probably something to solve in 6.0. But I think it is a gotcha worth noting, along with the workaround:

my %hash : Test('one', 'two', 'three\)');

Replies are listed 'Best First'.
Re: Re (tilly) 3: autotie in Attribute Handlers
by TheDamian (Vicar) on Nov 04, 2001 at 05:12 UTC
    Any human looking at this would say that the first closing paren is inside of a quoted string, and so this code is correct.

    Not a bug in Attribute::Handlers, but an inherent behaviour of the Perl 5 attribute mechanism. From attributes.pm:

    Each attribute specification is a simple name, optionally followed by a parenthesised parameter list. If such a parameter list is present, it is scanned past as for the rules for the `q()' operator. (See the section on "Quote and Quote-like Operators" in the perlop manpage.) The parameter list is passed as it was found, however, and not as per `q()'.