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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.