Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: filehandler stored in hash-ref

by jeanluca (Deacon)
on Dec 10, 2009 at 16:58 UTC ( #812238=note: print w/ replies, xml ) Need Help??


in reply to Re^2: filehandler stored in hash-ref
in thread filehandler stored in hash-ref

thats it!

But, if I see this

(in cleanup) Can't locate object method "opened" via package "IO::Hand +le"
I would say IO::Handle is already loaded, because its already using this package !


Comment on Re^3: filehandler stored in hash-ref
Download Code
Re^4: filehandler stored in hash-ref
by ikegami (Pope) on Dec 10, 2009 at 17:04 UTC
    All handles are virtually blessed to IO::Handle
    $ perl -e'STDOUT->autoflush(1)' Can't locate object method "autoflush" via package "IO::Handle" at -e +line 1.
    That doesn't mean the module is loaded:
    $ perl -e'(bless {}, "Foo::Bar")->doit()' Can't locate object method "doit" via package "Foo::Bar" at -e line 1.
Re^4: filehandler stored in hash-ref
by kyle (Abbot) on Dec 10, 2009 at 17:05 UTC

    You can bless some reference into a class without the class (package) being loaded.

    my $demo = bless {}, 'I::Just::Made::This::Up'; print "Things in UNIVERSAL:: work.\n" if $demo->isa('I::Just::Made::Th +is::Up'); $demo->opened(); __END__ Things in UNIVERSAL:: work. Can't locate object method "opened" via package "I::Just::Made::This:: +Up"
Re^4: filehandler stored in hash-ref
by jeanluca (Deacon) on Dec 10, 2009 at 17:22 UTC
    thnx kyle and ikegami, new stuff for me again!!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2015-07-07 07:17 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 (87 votes), past polls