John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
In C++, I could have a dummy object in the same scope having a destructor that did what I wanted.
That should be even simpler in Perl, where I can specify a block of code when constructing it!
So, has anyone done this yet?
Or, are there better ways to do this, such as using inner blocks/anonymous subs to cause the outer block to have a single return point anyway?
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(MeowChow) Re: 'finally' block in Perl?
by MeowChow (Vicar) on Jul 22, 2001 at 05:28 UTC | |
|
Re: 'finally' block in Perl?
by wog (Curate) on Jul 22, 2001 at 05:28 UTC | |
by matvore (Initiate) on Jan 06, 2019 at 15:19 UTC | |
by haukex (Archbishop) on Jan 06, 2019 at 16:21 UTC | |
by matvore (Initiate) on Jan 08, 2019 at 15:56 UTC | |
by haukex (Archbishop) on Jan 08, 2019 at 16:46 UTC | |
by John M. Dlugosz (Monsignor) on Jul 22, 2001 at 05:38 UTC | |
|
Re: 'finally' block in Perl?
by ariels (Curate) on Jul 22, 2001 at 11:06 UTC | |
by John M. Dlugosz (Monsignor) on Jul 22, 2001 at 11:13 UTC |