> the 'my' variable will correctly take the attribute, but the 'our' will > not and give the following error: > Invalid SCALAR attribute: watch at x.pl line 7 > > A quick debug run shows that it breaks due to some @ISA oddness: > # OK: > perl -MAttribute::Handlers -e'sub a:ATTR(SCALAR){1};our$x:a' > perl -MAttribute::Handlers -e'@ISA='b';sub b::a:ATTR(SCALAR);my$x:a' > > # BREAKS: > perl -MAttribute::Handlers -e'@ISA='b';sub b::a:ATTR(SCALAR);our$x:a' > Invalid SCALAR attribute: a at -e line 1 > BEGIN failed--compilation aborted at -e line 1. After looking a bit further, it shows that attributes on 'our' are resolved at compile time, and 'my' attributes are resolved at run time. From perldoc attributes: Variable attributes in "our" declarations are also applied at compile time. However, "my" variables get their attributes applied at run-time. So for the first part of this bug report, it was my expectation being wrong, and not a bug... however, it does make me wonder why the behaviour of our vs my is different...Thread Next