Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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


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

In reply to Re: Text::Diff::Table output, but want to show all lines by 2teez
in thread Text::Diff::Table output, but want to show all lines by Solo

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2021-12-07 07:00 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (33 votes). Check out past polls.