Subject: Re: multiple embedded interpreter example in perlembed.pod fails
Ken Fox <kfox@ford.com> wrote:
> I wrote:
>
> > Multiple embedded interpreters don't work. Here's a transcript:
> ...
> > ccflags =''
>
> Ugh. Stupid user error. I ran Configure with -DMULTIPLICITY instead
> of -Dccflags='-DMULTIPLICITY'. Sorry for the confusion.
you can also 'make LIBPERL=libperlm.a', libperld, libperldm, etc., or
edit cflags by hand after Configure.
> Could the
> runtime error message be improved to let people know when they've made
> this mistake?
good idea, something like the patch below? I'm not sure of other
cases where e_fp would be bogus.
p5p-msgid:
199703192345.SAA15070@postman.osf.org
if (!scriptname)
scriptname = argv[0];
if (e_fp) {
- if (PerlIO_flush(e_fp) || PerlIO_error(e_fp) || PerlIO_close(e_fp))
+ if (PerlIO_flush(e_fp) || PerlIO_error(e_fp) || PerlIO_close(e_fp)) {
+#ifndef MULTIPLICITY
+ warn("Did you forget to compile with -DMULTIPLICITY?");
+#endif
croak("Can't write to temp file for -e: %s", Strerror(errno));
+ }
e_fp = Nullfp;
argc++,argv--;
scriptname = e_tmpname;