The backslash operator means "adddress of" : Scalar Reference « Language Basics « Perl






The backslash operator means "adddress of"

   

#!/bin/perl
$num=5;
$p = \$num;       
print 'The address assigned $p is ', $p, "\n";
print "The value stored at that address is $$p \n";

   
    
    
  








Related examples in the same category

1.Get reference to a scalar
2.Passing scalar variable to a subroutine by reference using $_
3.Scalar alias
4.Using scalar reference