Welcome to the Monastery | |
PerlMonks |
Re^7: A complicated file parsing and 2D array/matrix problem.by Kenosis (Priest) |
on Aug 27, 2012 at 20:15 UTC ( [id://990054]=note: print w/replies, xml ) | Need Help?? |
It may be best to work on the A.txt and B.txt data sets you showed. If you can create a script to generate the ORed results of those two matrices, then it's most likely that script will work with larger matrices. First, always begin your scripts with either:
or
I prefer the latter, since it includes the former two pragmas--among other things. You can use File::Slurp qw/read_file/; to read a file's contents into an array. The foreach() takes a list or array--not a scalar, like you've done. That would account for some of the errors. Here's one way to approach the problem:
The scripting that produced the first table should help with reading files and building the table. Step through this scripting process, and then share what you've completed. A script can be created to produce the ORed output you need; it'll just take a little more work...
In Section
Seekers of Perl Wisdom
|
|