New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perl_eval_sv does not set PL_errgv for compile errors #6286
Comments
From andrew@pimlott.netCreated by andrew@pimlott.netI was disturbed to find that, in a simple embedded perl interpreter like the sub foo() { 2 } it will produce no output. Adding G_KEEPERR causes the expected error ("Too Here is what happens (as far as I can understand): - Perl_eval_sv calls call_body. I haven't wrapped my head around the reasoning behind all this, but I wonder I haven't tested perl 5.8, and I haven't found a workaround, though I At any rate, if this problem will affect every program that follows the Andrew Simple embedded interpreter: /* #include <EXTERN.h> static char *args[] = { "", "-e", "" }; int main(int argc, char **argv) len = fread(script, 1, 4096, stdin); perl_interp = perl_alloc(); err = SvPV(GvSV(PL_errgv), length); return 0; Perl Info
|
From rwilding@micron.comCreated by andrew@pimlott.netI was disturbed to find that, in a simple embedded perl interpreter like the sub foo() { 2 } it will produce no output. Adding G_KEEPERR causes the expected error ("Too Here is what happens (as far as I can understand): - Perl_eval_sv calls call_body. I haven't wrapped my head around the reasoning behind all this, but I wonder I haven't tested perl 5.8, and I haven't found a workaround, though I At any rate, if this problem will affect every program that follows the Andrew Simple embedded interpreter: /* #include <EXTERN.h> static char *args[] = { "", "-e", "" }; int main(int argc, char **argv) len = fread(script, 1, 4096, stdin); perl_interp = perl_alloc(); err = SvPV(GvSV(PL_errgv), length); return 0; Perl Info
|
From @HugmeirOn Fri Feb 07 07:42:33 2003, rwilding@micron.com wrote:
ldopts)
PATH=/home/pimlott/bin:/usr/local/atria/bin:/home/pimlott/local/j2sdk1.4.0/b in:/usr/sbin:/sbin:/home/pimlott/bin:/usr/local/atria/bin:/home/pimlott/loca l/j2sdk1.4.0/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/
I couldn't get the original script to run on 5.14.2 -- I guess the API |
From @Hugmeir#include <EXTERN.h>
#include <perl.h>
/*
$ cc -o 20772 20772.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
$ printf "sub foo() { 2 }\nfoo(1);" | ./20772
*/
int main(int argc, char **argv, char **env) {
PerlInterpreter *my_perl;
char *args[] = { "", "-e", "" };
char script[4096];
size_t len;
SV *sv;
char *err;
STRLEN length;
my_perl = perl_alloc();
perl_construct(my_perl);
len = fread(script, 1, 4096, stdin);
sv = newSVpv(script, len);
perl_parse(my_perl, NULL, 3, args, 0);
perl_eval_sv(sv, G_DISCARD | G_NOARGS);
err = SvPV(GvSV(PL_errgv), length);
if (length) {
sv_dump(ERRSV);
fprintf(stderr, err);
}
perl_destruct(my_perl);
perl_free(my_perl);
return 1;
} |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#20772 (status was 'resolved')
Searchable as RT20772$
The text was updated successfully, but these errors were encountered: