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

[perl #2917] INIT processing in 5.6.0

From:
James E Keenan via RT
Date:
August 31, 2013 01:47
Subject:
[perl #2917] INIT processing in 5.6.0
Message ID:
rt-3.6.HEAD-1873-1377913615-220.2917-15-0@perl.org
On Sat Aug 02 02:30:47 2008, animator wrote:
> On Wed Oct 11 01:19:16 2000, hv@hugo.hybyte.com wrote:
> > Larry suggested the 'too late for INIT block' bahaviour was 
> needlessly
> > unhelpful [0]. I notice it hadn't been fixed as of 5.7.0 - has anyone
> > the intention and/or the knowledge to fix this?
> > 
> > Hugo
> > 
> > [0] http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-
> > 04/msg00081.html
> > 
> 
> The code in question basically is:
> 
> #!/usr/bin/perl -l
> 
> use strict;
> use warnings;
> 
> print "before init";
> eval "INIT { print qq(in init); };";
> print "after init";
> 
> __END__
> before init
> Too late to run INIT block at (eval 1) line 1.
> after init
> 
> Still present in blead (5.11.0).

And present with 'say' in 5.18.0 as well:

#####
$ perl -w -E 'say "before init";eval "INIT { say qq(in init); };";say
"after init";'
before init
Too late to run INIT block at (eval 1) line 1.
after init
#####

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=2917



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