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

Re: eval_sv and exception handling

Thread Previous
Nick Ing-Simmons
February 1, 2003 02:47
Re: eval_sv and exception handling
Message ID:
Rwilding <> 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
>		$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

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About