Re: dereferencing
- From: aaron@xxxxxxxxxx (Aaron Priven)
- Date: Mon, 29 Oct 2007 22:16:35 -0700
Playing around with this, indeed, proves it can be done:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Alias;
my $hashref = { a => 5, b => 8};
alias my %hash = %{$hashref};
print $hash{a} , "\n";
prints 5. (And \%hash == $hashref evaluates true.)
I knew that Data::Alias existed -- it's mentioned in Perl Best Practices -- but at least to me, the documentation seemed to imply that it couldn't do this, or that it would act like "many scalar assignments in parallel".
Thanks!
On Oct 29, 2007, at 5:33 PM, Paul Johnson wrote:
Perhaps something like Data::Alias, for example, might do the trick.
--
Aaron Priven, aaron@xxxxxxxxxx, http://www.priven.com/aaron
.
- References:
- dereferencing
- From: Aaron Priven
- Re: dereferencing
- From: Jeremy Kister
- Re: dereferencing
- From: Tom Phoenix
- Re: dereferencing
- From: Paul Johnson
- dereferencing
- Prev by Date: Re: Hash Variables
- Next by Date: Re: dereferencing
- Previous by thread: Re: dereferencing
- Next by thread: Re: dereferencing
- Index(es):
Relevant Pages
|