From 7dd297223c1ac1442138e7d3a9beac593b5dadd1 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 21 Apr 2013 23:02:48 +0200 Subject: Tidy code. --- localworddiff | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/localworddiff b/localworddiff index e26e50c..1561684 100755 --- a/localworddiff +++ b/localworddiff @@ -22,16 +22,16 @@ use Text::WordDiff; use Text::Markdown qw[markdown]; use CSS::Tiny; -use HTML::HTML5::Builder qw[:standard];; +use HTML::HTML5::Builder qw[:standard]; use File::Slurp; use strictures 1; use autodie; -my ($infile1, $infile2, $outfile) = @ARGV; +my ( $infile1, $infile2, $outfile ) = @ARGV; die 'Missing input file arguments' - unless ($infile1 and $infile2); + unless ( $infile1 and $infile2 ); # use console if no output file provided as third argument unless ($outfile) { @@ -43,19 +43,19 @@ unless ($outfile) { my $diff = word_diff $infile1, $infile2, { STYLE => 'HTMLTwoLines' }; # apply markup to each file div of resolved diff -my $d = "
"; +my $d = "
"; my $d_ = "<\/div>"; my $i; my @diffchunk; foreach ( split /(?:$d_\n)?$d/, $diff ) { if ($_) { - $diffchunk[$i++] = $d.markdown($_).$d_; + $diffchunk[ $i++ ] = $d . markdown($_) . $d_; } } # parse styling my $css = CSS::Tiny->new(); -$css->read_string (<<'EOF'); +$css->read_string(<<'EOF'); .fileheader { display: none; visibility: hidden; @@ -80,11 +80,11 @@ EOF # compose and save web page my $page = html( head( - XML_CHUNK($css->html), + XML_CHUNK( $css->html ), ), body( - CHUNK($diffchunk[0]), - CHUNK($diffchunk[1]), + CHUNK( $diffchunk[0] ), + CHUNK( $diffchunk[1] ), ), ); write_file( $outfile, $page ); -- cgit v1.2.3