title: How to access global variable in subroutine
body: <p>Suppose, my global variable and local variables has same name, how can i access the global variable value in subroutine?</p>
  
  <pre><code>#! /usr/bin/perl
  
  $name = "Krishna";
  
  sub printName{
   my $name = "Sankalp";
  
   print ("Local name : ", $name, "\n");
   # How to print global variable here
  }
  
  &amp;printName;
  print("Global name : ", $name, "\n");
  </code></pre>