This is just a small script. I run to a continuous loop to check the directory and move every file that is there. This code works, and I run it in the background processes. But for some reason I get the following error: '/home/srvc_ibdcoe_pcdev/Niall_Test/new_dir/..' and '/home/srvc_ibdcoe_pcdev/Niall_Test/perl_files/..' are identical (not copied) at move2.pl line 27
any idea why she tells me that she is identical, although the paths are different?
Thank you very much
script below
#!/usr/bin/perl use diagnostics; use strict; use warnings; use File::Copy; my $poll_cycle = 10; my $dest_dir = "/home/srvc_ibdcoe_pcdev/Niall_Test/perl_files"; while (1) { sleep $poll_cycle; my $dirname = '/home/srvc_ibdcoe_pcdev/Niall_Test/new_dir'; opendir my $dh, $dirname or die "Can't open directory '$dirname' for reading: $!"; my @files = readdir $dh; closedir $dh; if ( grep( !/^[.][.]?$/, @files ) > 0 ) { print "Dir is not empty\n"; foreach my $target (@files) {
source share