Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Why mock doesn't work in this case?

by tobyink (Abbot)
on Jan 06, 2012 at 10:05 UTC ( #946571=note: print w/replies, xml ) Need Help??


in reply to Why mock doesn't work in this case?

Son::new doesn't return the blessed object. Try:

sub new { *{'Father::alert'} = sub { print 'son' . $/; }; bless {}, Son; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946571]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2017-11-24 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (354 votes). Check out past polls.

    Notices?