. . . RetrieveValues(); CheckImageArchieve(); sub RetrieveValues { print "\n\nSpecify the Directory path to image folder:\n"; $directory = (); chomp $directory; # $directory =~ s/\\/\\\\/g; } sub CheckImageArchieve { my $a = 0; opendir(DIR, $directory) or die "Cannot open directory $directory"; my @DIR = grep {$_ ne '.' && $_ ne '..' && grep (m/fpx/, $_)} readdir DIR; system ("cls"); while ($DIR[$a]) { print "$directory\\$DIR[$a]\n"; system("echo $directory\\$DIR[$a] >> c:\\dump.txt"); system("identify -verbose $directory\\$DIR[$a] >> c:\\dump.txt"); or system("echo ERROR: $directory\\$DIR[$a] >> c:\\error.txt"); $a=$a+1; } }