in reply to Re^3: Check if file exists in multiple directories
in thread Check if file exists in multiple directories
If I add the chomp and I print the current working directory, the only directory that gets printed is the first directory, multiple times(as many times there are files in the main directory). Any other thoughts? Thanks.#!/usr/bin/perl use warnings; use Cwd; $out = "outFile"; $newdir = $newdirectory; open(TABLEA, "dirlist"); @tablea = <TABLEA>; foreach $dir (@tablea) { chomp @tablea; chdir $dir; print(cwd); print "\n"; if (glob("*.txt")) { system("mv $out $newdir"); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Check if file exists in multiple directories
by hdb (Monsignor) on May 21, 2015 at 18:41 UTC |