in reply to Question about __PACKAGE__
These are exactly the same after the compile stage
These are also the same__PACKAGE__->hello('text1'); Foo->hello('text1');
The difference between f('x') and 'x'->f() is that if there is no sub f {} in Foo @INC will be used to look for one.hello(__PACKAGE__, 'text1'); hello('Foo', 'text1');
Look at UNIVERSAL and perltoot.
-- gam3
A picture is worth a thousand words, but takes 200K.
A picture is worth a thousand words, but takes 200K.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Question about __PACKAGE__
by sman (Beadle) on Jan 22, 2010 at 03:06 UTC | |
by ikegami (Patriarch) on Jan 22, 2010 at 07:15 UTC | |
by gam3 (Curate) on Jan 22, 2010 at 12:24 UTC |
In Section
Seekers of Perl Wisdom