#!/usr/bin/perl use strict; use Text::Diff; my @output; my @db; my @fs; my $diff = diff ("test.txt", "test2.txt", { OUTPUT => \@output } ); print $output[0]; #while (@output) { # my $item = shift(@output); # if ($item =~ m/^\+\//) { # $item =~ s/^\+\///; # print $item; # push (@db, $item); # } elsif ($item =~ m/^-\//) { # $item =~ s/^-\///; # push (@fs, $item); # } #} foreach my $dbitem (@db) { print $dbitem; } foreach my $fsitem (@fs) { print $fsitem; }