develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24118] AutoReply: attribute bug on 'our' in Attribute::Handlers

Thread Previous
Richard Clamp
October 5, 2003 04:41
Re: [perl #24118] AutoReply: attribute bug on 'our' in Attribute::Handlers
Message ID:
On Sun, Oct 05, 2003 at 04:19:13AM -0700, Jos I. Boumans wrote:
> 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...

It's so that attributes get (re)applied correctly to lexicals.
Consider calling these subroutines:

sub tail { 
   my $dog : Hairy;

sub story {
   our $dolly : Cute;

On every invocation of tail we have a new $dog, so it has to be make
Hairy at runtime.  Ever every time we tell the story we use the same
$dolly which was made Cute at time of manufacture.

Richard Clamp <>

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About