develooper Front page | perl.perl5.porters | Postings from September 2012

[perl #96672] Carp::croak doesn't quite replace die - missing <fh> line # phrase

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
September 14, 2012 18:29
Subject:
[perl #96672] Carp::croak doesn't quite replace die - missing <fh> line # phrase
Message ID:
rt-3.6.HEAD-11172-1347672569-1265.96672-15-0@perl.org
On Sun Dec 18 00:20:57 2011, sprout wrote:
> Attached is a proof of concept.  It still needs tests and docs.  It will
> probably have to wait till after 5.16.
> 
> With it applied:
> 
> $ ./perl -Ilib -le '<foo>; print ${^LAST_FH}; print \${^LAST_FH}; print
> ${^LAST_FH} =~ s/^\*//r; print ${^LAST_FH}->input_line_number;'
> *main::foo
> GLOB(0x823280)
> main::foo
> 0
> 
> So with a single new variable, you can get a real typeglob that you can
> select() or whatever.  And you can also get the name and current line
> number from it.
> 
> Who could ask for anything more?
> 
> Later we could even allowed it to be assigned to, such that ${^LAST_FH}
> = *foo would be more or less equivalent to tell(*foo), but without
> touching $!.
> 

Are we going to follow up on the approach taken in this patch?  Tests?

Thank you very much.
Jim Keenan

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

Thread Previous | 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