Re: goto return ?
- From: mlists@xxxxxxxxxxxxxxx (JupiterHost.Net)
- Date: Mon, 27 Nov 2006 14:37:49 -0600
Just need to figure you how to get the functionality that:
goto &CORE::return;
feels like it should do assuming I knew how to reference return...
nah
Thanks for your examples, however if a change was needed you'd still have to change every instance instead of the single function.
So I'd still really like to figure out how to get
goto &CORE::return;
type behavior despite the fact that you can't see why or when you'd need it.
For example I can, say, create an app that always:
error_return("Oops I did it again: $!", @return) if $whatever;
instead of
if($whatever) {
carp "Oops I did it again: $!";
return @return;
}
Why?
because say I've done that in hundreds of places acorss dozens of files., and the boss says "it needs to log to a file also".
now I have to edit every instance of it and quite possible miss some.
Or I could just add the logging code to error_return() and it would take seconds instead of hours or days and would have 100% coverage instead of possibly missing some.
It'd be infinitely more maintainable and is a basic idea used throughout Perl (Exporter's export_to_level and Carp's CarpLevel etc)
So any other ideas anyone?
.
- References:
- goto return ?
- From: JupiterHost.Net
- Re: goto return ?
- From: Tom Phoenix
- Re: goto return ?
- From: JupiterHost.Net
- Re: goto return ?
- From: Paul Johnson
- goto return ?
- Prev by Date: Win32::TieRegistry->Connect - How to specify credentials on remote machine?
- Next by Date: Re: goto return ?
- Previous by thread: Re: goto return ?
- Next by thread: Re: goto return ?
- Index(es):
Relevant Pages
|
|