title: perl: File::Copy: no such file or directory error on reading existing file
body: <p>I'm trying to download ruby gems listed in several example rails projects I downloaded via <code>bundle install</code> with the latest version of ruby installed through RVM, and I'm following the directions <a href="https://stackoverflow.com/questions/27265604/rails-server-not-running-after-updating-to-ruby-2-1-4">here</a> to properly downloads the gems listed in the bundler files. I thought I'd speed up the process with this perl script: (Not quite comfortable with bash yet):</p>
  
  <pre><code>#!/usr/bin/perl
  use File::Copy qq(copy);
  
  use strict;
  use warnings;
  
  my @files = `ls`;
  foreach my $dir (@files)
  {
      chomp $dir;
      if( -d $dir)
      {
          print "\n\n\tabout to enter $dir\n\n\n";
          print `cd "$dir"`;
          system("echo \"2.2.0\" &gt; .ruby-version");
          system("echo \"$dir\" &gt; .ruby-gemset");
          copy("Gemfile", "tmp.save") or die "copy: $!\n";
          open(RD,"&lt;tmp.save") or die "$dir: tmp.save: $!\n";
          open(WR,"&gt;Gemfile") or die "$dir: Gemfile: $!\n";
          print WR &lt;RD&gt;;
          print WR "\n";
          print WR "ruby \'2.2.0\'";
          print WR "\n\n";
          while(&lt;RD&gt;) { print WR $_; print WR "\n"; }
          close(RD); close(WR);
          print `cd ..`; 
          print `cd "$dir"`;
          print `bundle install`;
          print `cd ..`;
      }
  }
  </code></pre>
  
  <p>error is:</p>
  
  <pre><code>copy: No such file or directory
  </code></pre>
  
  <p>The file clearly exists these projects are presumably created with <code>rails &lt;name&gt;</code> command. Why would this happen and how do I fix it?</p>