From: Rob Dixon <[EMAIL PROTECTED]>
> It is common practice in most languages to pass an additional implicit
> parameter
> to method calls. Class methods like BOA::Logger2->new will have the class name
> passed as the first parameter, whereas object methods like $logger->level will
> have the object pass the object in the same place. That is really the only
> difference between calling
>
> BOA::Logger2->new('logs/boa.log')
>
> and
>
> BOA::Logger2:new('logs/boa.log')
>
> The first is a method call and so will have the class name passed as well as
> the
> parameter you provide explicitly.
In this particular case yes, but there is one more important
difference. In the first case the new() subroutine is looked up first
in the BOA::Logger2 package, then in the "parent" package (specified
via @BOA::Logger2::ISA or "use base ...."), its parent package etc.
It's a method so the inheritance rules apply.
In the second it's only looked up in the BOA::Logger2 package and if
not found there perl emits an error message.
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/