I have code that I'm trying to move matching files from one directory to another. When this runs it does not move the files to the directory I have on the move line. It moves to the directory I'm running from. Can someone more familiar with perl help?
Here is the code:
-----
#!C:\perl
my $filename="H:currdir\\zlist.lst";
my $line="";
if ( -e "$filename")
{
open(FILEOPENED, $filename) || die "Can't open file: $filename \n";
while ($line = <FILEOPENED>)
{
$filename=$line;
print "$line \n";
`MOVE "H:currdir1\\$line H:currdir2"`;
}
close(FILEOPENED);
}
else
{
print "no line was found.";
}
exit;
Here is the code:
-----
#!C:\perl
my $filename="H:currdir\\zlist.lst";
my $line="";
if ( -e "$filename")
{
open(FILEOPENED, $filename) || die "Can't open file: $filename \n";
while ($line = <FILEOPENED>)
{
$filename=$line;
print "$line \n";
`MOVE "H:currdir1\\$line H:currdir2"`;
}
close(FILEOPENED);
}
else
{
print "no line was found.";
}
exit;