Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: "Text" does something.

by Jenda (Abbot)
on Mar 24, 2013 at 02:03 UTC ( #1025102=note: print w/ replies, xml ) Need Help??


in reply to Re: "Text" does something.
in thread "Text" does something.

If there already is a package Foo in the running program, then "whatever Foo;" is assumed to mean call to static method whatever() in package Foo. If it's not and use strict is not in effect, the "Foo" is considered a bareword and the subroutine import() in current package is called and the string "Foo" is passed as the first parameter. In this particular case the module File::Basename is loaded by CPAN.pm or one of its dependencies, so Perl assumes you meant the first meaning.

It's preferable to use Foo->import() is you mean the static method call and import("Foo") if you mean the subroutine call.

Jenda
Enoch was right!
Enjoy the last years of Rome.


Comment on Re^2: "Text" does something.
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025102]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2015-07-29 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls