Exiting out of eval block...

From: Ajit P Singh (ajit.pal.singh_at_thus.net)
Date: 02/20/04


To: beginners@perl.org
Date: Fri, 20 Feb 2004 12:12:56 -0000

Hello Friens,

I have a eval block and some if conditions within it and I would like to
exit the eval block.
i.e

eval{
          my @resp = something;
      if ((some condition)){
              $str_output = "do something";
                --------> I want to exit from here....to Reach After Eval
                }
         else{
                some condition
                 --------> I want to exit from here....to Reach After Eval
            }
    };
    if($@){
        $str_output = "something";
        }
             
        Reach After Eval ...

which command can i use.. something like a break in java....

----------------------------------------------------------------------------
----------------

regards,

Ajitpal Singh,



Relevant Pages

  • Re: Exiting out of eval block...
    ... Ajit P Singh wrote: ... > I have a eval block and some if conditions within it and I would like to ... > exit the eval block. ... but your pseudo code is very unclear. ...
    (perl.beginners)
  • Re: Exiting out of eval block...
    ... > I have a eval block and some if conditions within it and I would like ... > to exit the eval block. ... perldoc -f return ... to get drunk and croon as much as they like. ...
    (perl.beginners)