--- loncom/publisher/londiff.pm 2006/12/05 02:55:55 1.22 +++ loncom/publisher/londiff.pm 2008/11/10 13:20:04 1.24 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show differences between file versions # -# $Id: londiff.pm,v 1.22 2006/12/05 02:55:55 albertel Exp $ +# $Id: londiff.pm,v 1.24 2008/11/10 13:20:04 jms Exp $ # # Copyright Michigan State University Board of Trustees # @@ -27,6 +27,24 @@ # ### +=pod + +=head1 NAME + +Apache::londiff + +=head1 SYNOPSIS + +Handler to show difference between two files. + +This is part of the LearningOnline Network with CAPA project +described at http://www.lon-capa.org. + +=head2 Subroutines + +=cut + + package Apache::londiff; use strict; @@ -55,16 +73,9 @@ sub get_split_file { } } } elsif ($style eq 'remote') { - my $f1=&Apache::lonnet::getfile($fn); - } - if ($f1=~/\r/) { - @f1=split(/\r/,&Apache::lonnet::getfile($fn)); - foreach my $line (@f1) { - $line=~s/\n//g; - } - } else { - @f1=split(/\n/,&Apache::lonnet::getfile($fn)); + $f1=&Apache::lonnet::getfile($fn); } + @f1=split(/\r\n|\r|\n/,$f1); return @f1; }