Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
laziness, impatience, and hubris
 
PerlMonks  

Re: strings->can->isa but numbers->can't?

by moritz (Cardinal)
on Apr 26, 2012 at 15:32 UTC ( #967387=note: print w/ replies, xml ) Need Help??


in reply to strings->can->isa but numbers->can't?

Strings are simply interpreted as package names when you call a method on them. This is how Foo->new works in the first place.

There is no such provision for numbers, arrays, hashes or subroutines.


Comment on Re: strings->can->isa but numbers->can't?
Download Code
Re^2: strings->can->isa but numbers->can't?
by djerius (Acolyte) on Apr 26, 2012 at 17:37 UTC
    Strings are simply interpreted as package names when you call a method on them. This is how Foo->new works in the first place.

    D'oh! Of course! I even use that behavior on occasion.

    Thanks for the reminder.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2013-05-20 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (409 votes), past polls