goto return ?

2006-11-24 Thread JupiterHost.Net
stuff ) if $whatever; # we got this far so keep on moving The trick is I can't seem to goto() return in do_some_stuff_and_return(), I'm sure since its so deep down... Anywho, any ideas would be awesome! TIA -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: goto return ?

2006-11-24 Thread Tom Phoenix
On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: The trick is I can't seem to goto() return in do_some_stuff_and_return(), I'm sure since its so deep down... Are you saying that you want a subroutine that can make the subroutine that called *it* return? I'm not

Re: goto return ?

2006-11-24 Thread JupiterHost.Net
Tom Phoenix wrote: On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: The trick is I can't seem to goto() return in do_some_stuff_and_return(), I'm sure since its so deep down... Are you saying that you want a subroutine that can make the subroutine that called *it*

Re: goto return ?

2006-11-24 Thread Mumia W.
On 11/24/2006 05:37 PM, JupiterHost.Net wrote: Tom Phoenix wrote: On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: The trick is I can't seem to goto() return in do_some_stuff_and_return(), I'm sure since its so deep down... Are you saying that you want a subrouti

Re: goto return ?

2006-11-25 Thread Paul Johnson
On Fri, Nov 24, 2006 at 05:37:35PM -0600, JupiterHost.Net wrote: > In a function I can do this: > > # stuff here > >if($whatever, @ret) { >one(); >two(); >goto &CORE::return; # this is pseudo code that does not work but > illustrates the idea of the goal >} > >

Re: goto return ?

2006-11-27 Thread JupiterHost.Net
What about doing this? return if do_one_then_two($whatever); ... sub do_one_then_two { my $what = $_[0]; if ($what) { one(); two(); return 1; } return 0; } Thanks, I'm not looking for how to handle a condition necessarily. I want to be able to: log_e

Re: goto return ?

2006-11-27 Thread JupiterHost.Net
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

Re: goto return ?

2006-11-27 Thread D. Bolliger
JupiterHost.Net am Montag, 27. November 2006 21:37: > > What about doing this? > > > > return if do_one_then_two($whatever); > > ... > > sub do_one_then_two { > > my $what = $_[0]; > > if ($what) { > > one(); > > two(); > > return 1; > > } > > return 0; > > }

Re: goto return ?

2006-11-27 Thread Rob Dixon
JupiterHost.Net wrote: What about doing this? return if do_one_then_two($whatever); ... sub do_one_then_two { my $what = $_[0]; if ($what) { one(); two(); return 1; } return 0; } Thanks, I'm not looking for how to handle a condition necessarily. I wan

Re: goto return ?

2006-11-28 Thread Tom Allison
Rob Dixon wrote: JupiterHost.Net wrote: What about doing this? return if do_one_then_two($whatever); ... sub do_one_then_two { my $what = $_[0]; if ($what) { one(); two(); return 1; } return 0; } Thanks, I'm not looking for how to handle a condition n

Re: goto return ?

2006-11-28 Thread Lawrence Statton XE2/N1GAK
> >> log_error_and_return($error, @return) if $whatever; Close you want return log_and_go_home($error, @return) if $whatever; sub log_and_go_home { my $message = shift; log_error($message); carp $message; return @_; } -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -

Re: goto return ?

2006-11-28 Thread Jenda Krynicky
From: "JupiterHost.Net" <[EMAIL PROTECTED]> > Thanks, I'm not looking for how to handle a condition necessarily. > > I want to be able to: > > log_error_and_return($error, @return) if $whatever; > > instead of > > if($whatever) { > log_error(); > carp $error; > return @ret

Re: goto return ?

2006-11-28 Thread JupiterHost.Net
Thanks to everyone for their feedback, I understand how to do basic logic and control flow, what I'm really looking for is how to get goto &CORE::return; to work like it reads. log_error_and_return($error, @return) if $whatever; Close you want return log_and_go_home($error, @return) i

Re: goto return ?

2006-11-28 Thread Jay Savage
On 11/28/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: But if you could do this: return_carp(...) if $whatever; the first time around then you could have 1 places it gets used in your app and still only change it in one place. And its pretty unambiguous IMHO. Next imagine the stamp it

Re: goto return ?

2006-11-28 Thread JupiterHost.Net
x27;&return' is the perldoc -f goto '&NAME' that is necessary: What I want to do is make it so that "goto &return;" : "exits the current subroutine (losing any changes set by local()) and immediately calls in its place the named

Re: goto return ?

2006-11-28 Thread Jay Savage
stions didn't I? Also perhaps CORE::return is wrong, Ii shoudl have clarified that its was pseudo code better. So assuming '&return' is the perldoc -f goto '&NAME' that is necessary: What I want to do is make it so that "goto &return;&

Re: goto return ?

2006-11-28 Thread Rob Coops
Hang on I guess I understand what it is you are trying to do... You want: goto &CORE::return; to work like it reads. Now my question to you is how does this read to you because what I am reading in the perlsub about this stuff is the following. Overriding Built-in Functions Many built-in funct

Re: goto return ?

2006-11-28 Thread JupiterHost.Net
Rob Coops wrote: Hang on I guess I understand what it is you are trying to do... You want: goto &CORE::return; to work like it reads. Now my question to you is how does this read to you because what I am reading in the perlsub about this stuff is the following. It reads this way: It "rea

Re: goto return ?

2006-12-03 Thread Peter Scott
On Mon, 27 Nov 2006 14:37:42 -0600, JupiterHost.Net wrote: > basically I want to override return to log and carp first, every time > its called. Oh. You want http://search.cpan.org/dist/Hook-LexWrap/lib/Hook/LexWrap.pm or some similar AOP module. -- Peter Scott http://www.perlmedic.com/ http:/

Re: goto return ?

2006-12-03 Thread Bill Jones
On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: The trick is I can't seem to goto() return in do_some_stuff_and_return(), I'm sure since its so deep down... I guess I'm totally confused; I don't see how a goto can return back to the sub-rotine that called i

Re: goto return ?

2006-12-04 Thread Jay Savage
On 12/3/06, Bill Jones <[EMAIL PROTECTED]> wrote: On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > The trick is I can't seem to goto() return in > do_some_stuff_and_return(), I'm sure since its so deep down... I guess I'm totally confused; I don't

Re: goto return ?

2006-12-04 Thread JupiterHost.Net
Bill Jones wrote: On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: The trick is I can't seem to goto() return in do_some_stuff_and_return(), I'm sure since its so deep down... I guess I'm totally confused; I don't see how a goto can return back to the

Re: goto return ?

2006-12-05 Thread JupiterHost.Net
Thaks Jay, I'll soak it all up tomorrow first thing, I'm sleepy :) Good night all! Jay Savage wrote: On 12/3/06, Bill Jones <[EMAIL PROTECTED]> wrote: On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > The trick is I can't seem to goto() return in >