Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 meditating upon the Monastery: (4)
As of 2017-08-21 17:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (324 votes). Check out past polls.

    Notices?