develooper Front page | perl.perl5.porters | Postings from October 2016

[perl #129239] BEGIN blocks have wrong caller package

From:
l.mai@web.de via RT
Date:
October 21, 2016 13:20
Subject:
[perl #129239] BEGIN blocks have wrong caller package
Message ID:
rt-4.0.24-7868-1477056031-1812.129239-15-0@perl.org
On Sat Sep 10 02:13:50 2016, mauke- wrote:
> #!perl
> use strict;
> use warnings;
> 
> package Mtfnpy;
> #line 100 "ABCDE"
> BEGIN {
>     printf "package=%s, file=%s, line=%d\n", caller;
> }
> 
> __END__
> 
> Output:
> package=main, file=ABCDE, line=102
> 
> Expected output:
> package=Mtfnpy, file=ABCDE, line=102

Here's a patch that adds a TODO test for now.

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



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