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
James E Keenan via RT
September 14, 2012 18:29
[perl #96672] Carp::croak doesn't quite replace die - missing <fh> line # phrase
Message ID:
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

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