in reply to Re: Re: Re: Re: Re: Global symbol requires explicit package name
in thread Global symbol requires explicit package name
What happens if $mailer is undef or some other scalar value, which is not a blessed object reference?
Well, this generates a run time error of the form Can't call method "close" without a package or object reference
If $mailer happens to be a string containing a package name, then the method call will work, passing in the package name as first implicit parameter. For example, the new method as in:
Note that an ordinary class method call uses this form, but with a bareword package name (which is made into a string).my $pkg = "Foo::Bar"; my $obj = $pkg->new;
Hope this helps
|
|---|