inblosam has asked for the wisdom of the Perl Monks concerning the following question:
and the other way is:#!/usr/bin/perl -w use strict; use Text::ParagraphDiff; my $copy_old = qq|the first line the second line is here this really should be on separate lines, no? weird eh?|; my $copy_new = qq|the FIRST line the second line is there not here this really should be on sequential lines, no? weird huh?|; #THIS IS THE DIRECT TEXT METHOD #THAT LINE BREAKS GET IGNORED print text_diff(["$copy_old"], ["$copy_new"]);
#THIS IS THE FILE METHOD THAT WORKS #AND DOESN"T IGNORE LINE BREAKS print text_diff('/somepath/old.txt','/somepath/new.txt');
or$copy_old =~ s/\n/\r\n/;
$copy_old =~ s/\r\n/\n\n\n\n/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Line breaks being ignored?
by duff (Parson) on Dec 05, 2003 at 05:04 UTC | |
by inblosam (Monk) on Dec 05, 2003 at 05:27 UTC |