title: glob() function in Perl for getting filenames
body: <p>How can I get the specific name of a file stored in a particular folder using glob() function? I have a sample source code below but having different output, it rather displays the complete path of the file instead of showing only the specific file name. How can I retrieve the file name only from the path set or how can I directly access and get the specific file name? thanks!</p>
  
  <pre><code>@files = glob('/Perl/Assignment/*');
  foreach $files(@files){
      print "$files\n";
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>/Perl/Assignment/file1.txt
  /Perl/Assignment/file2.txt
  /Perl/Assignment/file3.txt
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>file1.txt
  file2.txt
  file3.txt
  </code></pre>