in reply to Compare and copy array values
If I understand correctly, the keys of the hash %seen will be the directory names, so what you need to compare is the filename to those hash keys. What you are doing now is compare the filename to the value of one hash key.
what you want is to check if the result of the pattern match is a directory that has been seen.
foreach $i(@update){ $i =~ /^(\d{4})/; # match and grab into $1 the first four digit +s if($seen{$1} == 1){ # test if the dir has been seen copy($i,$to_dir); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Compare and copy array values
by Narveson (Chaplain) on Mar 19, 2008 at 20:14 UTC |