Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello mao9856,
Have you run the code you posted? @counts and even more open my A, "<", "@counts "could not open file1 $!"; make no sense at all. Also foreach (@ARGV) makes no sense infact you are never using $_ the implicit variable filled for you by foreach when you do not specify a named variable. So the beginning of your program must be better wrote as:
Use print to debug your program: print "DEBUG: working on file [$_]\n" as first line of the loop will confirm you are reading all files. Then you do not need to split you lines as you want to check for ID121 ABC14 whole presence in every file. So put the whole line as key of the results hash and ++ it as you are doing. A tip: as you need only strings that are in all files add every entry of the first file and then for following files just ++ keys that are already present in the hash. L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS. In reply to Re: find common data in multiple files
by Discipulus
|
|