programming-examples/perl/Datatype/Creating and Dereferencing Pointers.pl
2019-11-15 12:59:38 +01:00

7 lines
504 B
Perl

Assignment Create a Reference Dereference Dereference with Arrow
$sca= 5; $p = \$sca; print $$p;
@arr=(4,5,6); $p = \@arr; print @$p; $p->[0]
print $$p[0];
%hash=(key=>'value'); $p = \%hash; print %$p; $p->{key}
print $$p{key};