in reply to Re^6: A complicated file parsing and 2D array/matrix problem.
in thread A file parsing and 2D array/matrix problem.
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:
use strict; use warnings;
or
use Modern::Perl;
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...
|
|---|