trizen has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
Is it possible to, automatically, call some other method before calling the final method?
package Foo { sub new { bless [] }; sub msg { print "On my way to '%s'\n"; # name of the final method is op +tional } sub Berlin { print "I'm in Berlin!\n"; } sub Paris { print "I'm in Paris!\n"; } }; my $obj = Foo->new; $obj->Berlin(); # should go first in msg(), then in Berlin()
Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Calling an intermediate method
by tobyink (Canon) on Dec 18, 2013 at 23:45 UTC | |
by trizen (Hermit) on Dec 19, 2013 at 00:20 UTC | |
by tobyink (Canon) on Dec 19, 2013 at 10:59 UTC | |
Re: Calling an intermediate method
by choroba (Cardinal) on Dec 18, 2013 at 23:51 UTC | |
Re: Calling an intermediate method
by AnomalousMonk (Archbishop) on Dec 19, 2013 at 18:59 UTC | |
Re: Calling an intermediate method
by locked_user sundialsvc4 (Abbot) on Dec 19, 2013 at 00:27 UTC |