Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

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

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

Title:
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2021-10-25 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (89 votes). Check out past polls.

    Notices?