title: Can you symlink a directory and all its contents in Perl?
body: <p>I am quite new to Perl and have figured out how to symlink files.  Can you do this with directories as well?  I would like to make a symlink between a certain directory and one or more other directories so if I edit a file in the original directory, changes will be updated in the symlinked directories.  Is this possible?</p>
  
  <p>edit: my Perl code for creating symlinks for files in a given directory is below.</p>
  
  <p>Thanks</p>
  
  <pre><code>#!/usr/bin/perl
  
  $fileDirectory = "/home/Alan/Perl/Files/";
  $symLinkDirectory = "/home/Alan/Perl/SymFiles/";
  
  opendir ( DIR, $fileDirectory ) || die "Error in opening directory $fileDirectory\n";
  
  while( ($fileName = readdir(DIR))){
      my $filePath = $fileDirectory.$fileName;
      symlink("$filePath","$symLinkDirectory".$fileName);
  }
  
  closedir(DIR); 
  </code></pre>