There are several ways to force Perl use less memory.
- using Inline::C create C's subroutine that implements your two-dimensional array
- use one single scalar value and simulate your array by taking proper substr
- If your array is really all 1-s with few exceptions, just store such exceptions in another array and write a simple sub that simulates your 2D array.
May be some more.
Courage, the Cowardly Dog