in reply to Comparing 2 files!!
Assuming your first file is in a consistant format, you can trim off everything not in between quotes before saving to the hash. You could do your first while loop like this:
while (<F1>){ s/\A [^"]* # Read until we get to a quote char " # The actual quote char ([^"]*) # Read (and save) until we hit another quote char /$1/x; $HASH{$_}++; }
This will fail for embedded double-quotes, but most programs fail when that happens, anyway, so I wouldn't worry about it.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|
|---|