Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Text::Diff help

by jethro (Monsignor)
on Feb 23, 2012 at 10:54 UTC ( #955699=note: print w/ replies, xml ) Need Help??


in reply to Text::Diff help

If you change the line to

my $diff = diff "output.new", "output.new", { STYLE => "Unified" , OUT +PUT => \*DIFF };

what is the output then? If you see the whole file the diff module is implicated. If not, it could mean there are white space differences in your files. Did you check the files with the diff command line tool?

UPDATE: You never close the file output.new after you write to it. The data is probably still in the buffer waiting to be written to disk when you do the diff (disk operations are buffered so that not every write of a single character rewrites a whole disk block). Only after the script finishes, close is called automatically and the contents written


Comment on Re: Text::Diff help
Download Code
Re^2: Text::Diff help
by whittick (Novice) on Feb 23, 2012 at 11:35 UTC

    Thanks for pointing out the 1.log and 2.log moritz, that was from a previous attempt so cretainly won't help!

    Thanks for all the pointers about closing my filehandle, I'll give that a go!

      working perfectly now - thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://955699]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-09-23 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (241 votes), past polls