Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: require mystery

by Pstack (Scribe)
on Sep 06, 2007 at 22:27 UTC ( #637551=note: print w/replies, xml ) Need Help??


in reply to Re^3: require mystery
in thread require mystery

Yes, I see, and like your custom function. The code had been working previously with an expression eval before I altered it to the FIRST block eval.

Did you notice how I was thrown off by the success nearby of the SECOND block eval which survived all versions:

eval {$pathtool->import("mkpath")}; #OK

which would not then seem right either if similarly translated as ..(though it may be right?)..:

"File::Path"->import("mkpath");#??

Mmm!

cheers

Pstack

Replies are listed 'Best First'.
Re^5: require mystery
by Corion (Pope) on Sep 07, 2007 at 06:17 UTC

    Perl allows barewords or strings (which are basically the same, except that a bareword comes without quotes, hence, "bare") as invocants:

    File::Path->import(...)

    is the same as:

    "File::Path"->import(...)

    and

    my $pathtool = "File::Path"; $pathtool->import(...)

    and all three translate to:

    File::Path::import("File::Path",...);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2020-10-20 23:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (212 votes). Check out past polls.

    Notices?