Hey, I edited that.
I really don't see what advantage __PACKAGE__ has over a hardcoded class name except that it's Pythonesquely uglier.
Alright, I can hear dozens of keyboards getting ready to type "What about inheritance, you dope?" Before you get excited, try this little program:
package Foo; sub new { bless {}, __PACKAGE__; } package Bar; use vars qw( @ISA ); @ISA = 'Foo'; package main; my $bar = Bar->new(); print "Bar is a ", ref $bar, "\n";
Yep, the package into which it's compiled. Nope, not all that useful. Pity.
Update: Okay, if you don't like hardcoding the class name, there's an advantage. The Class module gets rid of the ugliness. That's kinda useful.
In reply to Re: Re: if (UNIVERSAL::isa($r, ref $l))
by chromatic
in thread if (UNIVERSAL::isa($r, ref $l))
by hossman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |