Dan Sugalski wrote:
> >IMO the name of the currently executing sub should be accessed via an
> >extention to C<caller()>.
> >
> > caller{subname}
>
> Oh? What prints, then?
>
> $foo = sub {print caller{subname}};
> $foo->();
something like CODE(0x80cfd7c) since we don't have a better name for it.
--- warning --- bad idea follows ---
Are we willing to let user-code use codereftagstrings abckwards yet?
perl -le '$a = \(1..4); $tagstring="$a"; print @{$tagstring}'
We would eliminate all strings matching /^[A-Z]\(0x[0-9a-f]+\)\z/ from
use as variable names. I don't think that would break all that much but
the 5->6 converter could identify ref->stringify and mung it slightly,
maybe add a \0 at the end or something.
We would gain C style casting capability, with all the evil that brings
with it, including the ability to bittwiddle perl structures from
within perl, which is a feature migrating C programmers miss.
But we would need to check every instance of X{$Y} where X is
a syntactic variable-type-identifier against the it's-a-refstring
regex. Maybe a pragma to turn these checks on?
use unsafe_string_dereferences
would anyone use it?
--
David Nicol 816.235.1187 [EMAIL PROTECTED]
www.tmcm.com, dammit