happyrainb has asked for the wisdom of the Perl Monks concerning the following question:
my $directory = '/usr/local/XML'; opendir(DIR,$directory); my @files = grep { $_ ne '.' && $_ ne '..' } readdir DIR; closedir(DIR);<BR> foreach(@files){ open (FILE,"$directory/$_") my $files="$_"; while(<FILE>){ print $_; if ($_=~/(<asset-id)(.*?)>/){ print "\t\t <local-id>$files</local-id>\n"; } } close(FILE); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: output can be displayed in screen, but not in output file
by kyle (Abbot) on Nov 28, 2007 at 04:28 UTC | |
|
Re: output can be displayed in screen, but not in output file
by tachyon-II (Chaplain) on Nov 28, 2007 at 07:34 UTC | |
by happyrainb (Novice) on Nov 28, 2007 at 15:12 UTC | |
by tachyon-II (Chaplain) on Nov 29, 2007 at 02:29 UTC |