Dereferencing hash : Hash Reference « Hash « Perl






Dereferencing hash

    

#!/usr/bin/perl
use warnings;
use strict;
my @array = (1, 2, 3, 4, 5);
my $array_r = \@array;
print "This is our dereferenced array: @$array_r\n";
for (@$array_r) {
    print "An element: $_\n";
}
print "The highest element is number $#$array_r\n";
print "This is what our reference looks like: $array_r\n";

   
    
    
    
  








Related examples in the same category

1.Using references to a hash.
2.Hash References
3.Anonymous Hash References
4.Get hash value by using the hash reference
5.Get key value pair through hash reference
6.Reference for hash
7.Hard References-Pointers
8.Using -> opertor with hash reference variable
9.Using each function with hash reference
10.Using keys function with hash reference variable