On 3 July 2015 at 18:54, bikram behera <[email protected]> wrote:
> Hi Team,
>
>
> Any body can explain me how to do perl hash refernce and dereference.
>
Create a hash:
my (%hash) = ( "key" => "value" , "otherkey" => "othervalue" );
Create a reference to said hash:
my $reference = \%hash;
You can also make a hash reference simply in one step with:
my $reference = { "key" => "value", "otherkey" => "othervalue"};
Dereference is simple:
my ( %otherhash ) = %{ $reference };
This material is covered in depth in `perldoc perlref`
--
Kent
KENTNL - https://metacpan.org/author/KENTNL
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/