develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #70357] duff DATA segment in -e

Thread Next
Father Chrysostomos via RT
July 12, 2013 07:46
[perl #70357] duff DATA segment in -e
Message ID:
On Mon Nov 09 08:33:58 2009, wrote:
> This is a bug report for perl from,
> generated with the help of perlbug 1.36 running under perl 5.10.0.
> -----------------------------------------------------------------
> [Please enter your report here]
> $ perl -we $'print <DATA>;\n__DATA__\nfoo\n'
> $
> In -e, the __DATA__ token marks the end of the Perl code, as usual,
> but the following characters are not available in the DATA filehandle.
> However, the DATA filehandle does exist, unlike what happens if
>    __DATA__
> (and following data) don't appear at all.  The abstraction is leaking.

It creates *DATA{IO} and then does IoIFP(GvIOp(gv)) = PL_rsfp;

Inside string eval PL_rsfp is NULL, so an unopened handle is created.

Fixing this could entail creating an in-memory handle with
PerlIO::scalar.  miniperl would have to forego this capability.


Father Chrysostomos

via perlbug:  queue: perl5 status: open

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