As far as back-porting it, I would suggest a prototype of $$, and require the user explicitly reference the variables. The other solution is three functions, one for scalars, one for arrays, and a third for hashes; I suppose that's ok too. So let's do both:
Well, that was awfully easy. But here's the deal. I'll make two functions in the XS file -- one for pre-5.8, and one for post-5.8. When the module is used, it'll alias (how funny!) alias() to the proper one.package Lexical::Alias; # alias() is the XS function # with a prototype of ($$) # the following are merely wrappers sub alias_s (\$\$) { goto &alias } sub alias_a (\@\@) { goto &alias } sub alias_h (\%\%) { goto &alias } 1;
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
In reply to Re: (tye)Re: Lexical Aliases avaiable
by japhy
in thread Lexical Aliases available
by japhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |