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

[perl #70357] duff DATA segment in -e

Thread Next
From:
Father Chrysostomos via RT
Date:
July 12, 2013 07:46
Subject:
[perl #70357] duff DATA segment in -e
Message ID:
rt-3.6.HEAD-2552-1373615183-1508.70357-15-0@perl.org
On Mon Nov 09 08:33:58 2009, zefram@fysh.org wrote:
> 
> This is a bug report for perl from zefram@fysh.org,
> 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
https://rt.perl.org:443/rt3/Ticket/Display.html?id=70357

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About