On Fri, May 18, 2007 at 01:58:20PM -0700, Dean Arnold wrote: > Patrick Galbraith wrote: > >Hi all! > > > >Quick question - how do I ensure from C something that I eval on the > >perl side, if it fails sets [EMAIL PROTECTED] Say for instance, I have > >something that > >checks something in C, I return in a way that eval/$@ is set.
It's not very clear what you're actually trying to do, Patrick. To many "something"s and no concrete example. > If I understand your issue, see the section on > "Warning and Dieing" in perlapi (http://perldoc.perl.org/perlapi.html) > In brief, use either croak() (or Perl_croak()), or set errsv > directly (from the perlapi page): > > errsv = get_sv("@", TRUE); > sv_setsv(errsv, exception_object); > croak(Nullch); > > If OTOH you're trying to validate $@ from C, then you > need to run under eval_pv/sv(). See > "Evaluating a Perl statement from your C program" > in perlembed (http://perldoc.perl.org/perlembed.html) And for good measure, I'll wave my hand in the direction of http://perldoc.perl.org/perlcall.html Tim.