in reply to if file does not exist
You test whether a file exists using -e. Together with some cleanup, that means:
use Fcntl 'O_RDWR'; for my $id ( @row ) { my $fname = "../XML/$id.xml"; next if not -e $fname; tie my @array, 'Tie::File', $fname, mode => O_RDWR; splice @array, 2, 0, "<database_id=\"gl:redunant\">"; untie @array; }
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: if file does not exist
by Anonymous Monk on Nov 21, 2005 at 17:27 UTC |