programming-examples/perl/Datatype/Dereferencing the Pointer.pl

6 lines
184 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/bin/perl
$num=5;
$p = \$num; # $p gets the address of $num
print 'The address assigned $p is ', $p, "\n";
print "The value stored at that address is $$p\n"; # dereference