title: Using Perl glob with spaces in the pattern
body: <p>I am trying to zip files from a directory. It works well except when the file name has spaces.</p>
  
  <p>Since <code>glob</code> splits its parameter on spaces, I also tried <code>bsd_glob</code> but it did not work.</p>
  
  <p>How do I handle spaces in the file names? I am seeking to retrieve all files.</p>
  
  <pre><code>#Directory of focus
  my $log = 'C:/Users/me/Desktop/log';
  
  my @files = bsd_glob( $log.'/*.*' );
  
  #Copy contents to new directory to be zipped
  foreach my $file (@files) {
     copy($file, $logout) or die
     "Failed to copy $file: $!\n";
  }
  </code></pre>
  
  <hr>
  
  <p>Fail to copy</p>
  
  <pre><code># Create Child tmp
  my $out = 'C:/Users/me/Desktop/out';
  mkdir $out;
  
  # Directory of focus
  my $log = 'C:/Users/me/Desktop/log';
  
  opendir (DIR, $log) or die $!;
  
  while ( my $file = readdir(DIR) ) {
      next if $file =~ /^\./;
      #print "$file\n";
      copy($file, $out) or die "Failed to copy $file: $!\n";
  }
  
  closedir (DIR);
  </code></pre>