You're right.  I am mistaken :-(.  Just tested it, and it was
something silly in an old script I had lying around that I thought was
a bug... my mistake.  (Note to self: Test all examples before
posting... or you look like an idiot :-) )

Sorry,
Shane.

> I think you're mistaken. Try the following:
> 
> package My::Test;
> 
> sub new {
>   return bless {}, shift;
> }
> sub DESTROY {
>   warn "destroyed";
> }
> sub test {
>   my $object = new My::Test;
>   print ref $object, "\n";
>   # object will get destroyed when it goes out of scope (now)
> }
> 
> for (1..10) {
>   warn "t $_\n";
>   test();
> }
> 
> __END__
> 
> Your second example doesn't do what I think you were expecting.
> 
> Jim

Reply via email to