Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2016-10-01 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (3 votes). Check out past polls.