
umpty
Novice
Jan 23, 2003, 1:49 PM
Post #4 of 17
(31201 views)
|
Re: [BackUp] Extracting a 36 digit word (object handle)
[In reply to]
|
Can't Post
|
|
Thanks for your reply: I incorporated the following code... my $found = {}; my $dir = 'C:\Search Express\OGC Images'; opendir DIR, $dir or die $!; for my $file(grep { !/^\./ } readdir(DIR)) { open FILE, "$dir/$file" or die $!; while (<FILE>) { if (/\b(.{36})\b/) { $found{$file} = $1; last; } } close FILE; } close DIR; if (scalar keys %$found) { open FILE, $new or die $!; print FILE join "\n", map { "$_ => $found->{$_}" } keys %$found; close FILE; } and received the following error: Name "main::new" used only once: possible typo at imagefiles.pl line 16 Name "main::found" used only once: possible typo at imagefiles.pl line 8 Here are two other caveats: ---I am only interested in files within the directory that end with an .wmk extension. ---I am using Active State (Windows Perl) As stated, thanks for your reply, but if any of you have any further time to look at this, it would be immensely appreciated. Thanks
|