develooper Front page | perl.perl5.porters | Postings from February 2003

Re: eval_sv and exception handling

Thread Previous
From:
Nick Ing-Simmons
Date:
February 1, 2003 02:47
Subject:
Re: eval_sv and exception handling
Message ID:
20030201104713.1872.6@bactrian.ni-s.u-net.com
Rwilding <rwilding@micron.com> writes:
>
>Now, I have a new problem:  If the expression compiles and MY_eval_pv
>returns a valid CV and that CV kicks out an exception there is no way to
>trap that exception! In plain perl i could do this (gf is an imaginary user
>typo):
>
>		$test=eval "sub{$p=5;$out=gf$p;return $out}";
>		eval{
>			&$test
>		}	
>		if($@)
>		{
>			print "Error", $@
>		}
>
>But there is no way (that i can see) to do an eval round an anonymous
>subroutine called with call_sv.  
 
   count = call_sv(cv, G_EVAL);
   if (SvTRUE(ERRSV))

-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About