#!/usr/bin/perl use strict; use warnings; use Tie::File; tie my @x, "Tie::File", $ARGV[0] or die $!; tie my @y, "Tie::File", $ARGV[1] or die $!; my %diff; for(@x) { $diff{$_}{x}++ if(substr($_,0,1) eq '/'); } for(@y) { $diff{$_}{y}++ if(substr($_,0,1) eq '/'); } my (@db, @fs); for my $path (sort keys(%diff)) { my $elm=$diff{$path}; next if($elm->{x} && $elm->{y}) push(@db,$path) if($elm->{x}); push(@fs,$path) if($elm->{y}); } foreach my $dbitem (@db) { print $dbitem, "\n"; } foreach my $fsitem (@fs) { print $fsitem, "\n"; }