Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Type globs, strict, and lexical variables

by xmath (Hermit)
on Jul 19, 2006 at 09:16 UTC ( #562236=note: print w/replies, xml ) Need Help??


in reply to Re^2: Type globs, strict, and lexical variables
in thread Type globs, strict, and lexical variables

Data::Alias isn't that heavyweight I think... I know it's a bit largeish module, but unlike tie() its use imposes virtually no overhead at runtime, and very little at compile time (no source filter).

And it solves your problem nicely, and probably more efficiently than anything involving typeglobs:

alias my @bar = @$foo;

UPDATE: It actually benchmarks faster than local *bar = $foo on my machine, with the benefit of being truly lexically scoped.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://562236]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2016-12-10 17:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (164 votes). Check out past polls.