Scalar alias : Scalar Reference « Language Basics « Perl






Scalar alias

    


#!/usr/bin/perl -w
use strict;

our $scalar1="one";
*scalar2=\$scalar1;
our $scalar2="two";
print $scalar1;

   
    
    
    
  








Related examples in the same category

1.Get reference to a scalar
2.Passing scalar variable to a subroutine by reference using $_
3.Using scalar reference
4.The backslash operator means "adddress of"