When you use a filehandle in a list context (e.g. your line @second_file{map { unpack 'A*', $_ } <$b_fh>} = ();) it reads the entire contents splitting it into lines (modulo $/ of course; see perlvar). The next time you use that same filehandle, since everything's been read from the file it's just going to return undef because it's at the end of the file. You need to either close and re-open it, or use seek to set the file pointer back at the beginning of the file (at which point reading from it will again return the lines).
@second_file{map { unpack 'A*', $_ } <$b_fh>} = (); seek( $b_fh, 0, 0 ); ## Reset $b_fh back to the beginning
That aside, if you're on a *NIX-y system you might be interested in the diff or cmp commands instead.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: output using map
by Fletch
in thread output using map
by coding_new
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |