in reply to Re^3: Delete files if they match help!
in thread Delete files if they match help!
... my $dir_to_open = "../../pics"; my $dir_to = "../../back"; while (my $row = $sth->fetchrow_hashref()) { for my $imgfile (map $row->{"image_$_"}, 1..4) { my $file_to_move = "$dir_to_open/$imgfile"; if (-e $file_to_move && -f $file_to_move) { move($file_to_move, $dir_to); } #.. then delete the file unlink $file_to_move if (-e $file_to_move && -f $file_to_ +move); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Delete files if they match help!
by roboticus (Chancellor) on Jan 07, 2011 at 19:38 UTC | |
by Anonyrnous Monk (Hermit) on Jan 08, 2011 at 01:12 UTC | |
by Anonymous Monk on Jan 07, 2011 at 19:51 UTC |