in reply to how to a specific group of files from source directory to destination directory

i cannot see the copy function anywhere in your code

anyway you properly needs something like

#!/usr/bin/perl -w use strict; use File::Copy; # Desitnation directory my $DesDir = ''; # Source dir name print "Enter Source dir: "; chomp(my $Source = <STDIN>); if (!-d $Source ) { print "Dir : $Source doesn't exists\n"; exit; } opendir(DIR,$Source); while (my $F = readdir(DIR)) { next if ($F!~m/\.log$/); copy("$Source/$F","DesDir/$F"); } closedir(DIR); print "Copy Complete\n";

HTH

  • Comment on Re: how to a specific group of files from source directory to destination directory
  • Download Code