Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 perusing the Monastery: (6)
As of 2017-02-21 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (309 votes). Check out past polls.