Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
go ahead... be a heretic
 
PerlMonks  

Re: Alias $hashref referent to a hash

by hlen (Beadle)
on Oct 22, 2004 at 15:42 UTC ( [id://401653]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Alias $hashref referent to a hash

Thanks, folks, this is all very interesting. I also found that Lexical::Alias works for this.
use Lexical::Alias ('alias'); my $ref = { a => 'b', c => 'd' }; my %hash; alias %{$ref}, %hash; print $ref->{'a'}; $hash{'a'} = 'e'; print $ref->{'a'};
Yields:
$ perl alias.pl b e
The funny ordering, which goes against the common syntax in shells for the alias statement, got to me the first time. Nevertheless, these non modular solutions were what I wanted to know about.

Cheers

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://401653]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.