Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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 "", "", { 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 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

Replies are listed 'Best First'.
Re^2: Text::Diff help
by whittick (Acolyte) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://955699]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2018-06-21 03:04 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.