http://www.perlmonks.org?node_id=1110114


in reply to Text::Diff::Table output, but want to show all lines

Hi Solo,
..But sometimes I want to show all the lines, not only the differences with surrounding context..

I don't know how you are using Text::Diff::Table and what you mean to show all the lines.
For in my experience, I have a table of all the lines. And the lines with difference are indicated by * at both side of the table, showing both files.
More like what diff command in Linux will give you when used with the option y like so: diff -y file1 file2

Update:

If you do this, in your script
my $diff = diff $file1, $file2, { STYLE => "Table" }; print $diff;
You will have a table, comparing the two files, and showing differences. Just like I mentioned previously.

But without the { STYLE => "Table" } in that script, you will only have want I suppose you have now.
And like I said, you weren't telling how you are using the module. But, I think this is what you want.

Please Note:
That if you use diff $file1, $file2 { STYLE => "Table" }; as given from the documentation of Text::Diff::Table, which is a bit different from that of Text::Diff. Note there is no , after $file2, before {. And that without the use strict; pragama, you have just the difference between the files listed and no error BUT with the use strict;, you will end up with compilation errors.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me