Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Recursive Directory Comparison and Export Differences

by shmem (Chancellor)
on Mar 09, 2017 at 11:52 UTC ( [id://1184022]=note: print w/replies, xml ) Need Help??


in reply to Recursive Directory Comparison and Export Differences

So my question is, have a missed something?

hmm... the output of your last script

$VAR1 = [ 'Only in test1/: different1', 'Only in test2/: different2', 'Only in test2//common: common.txt~', 'Files test1//common/common.txt and test2//common/common.txt + differ' ]; --- test1//common/common.txt Wed Mar 8 11:41:08 2017 +++ test2//common/common.txt Wed Mar 8 11:44:35 2017 @@ -1 +1 @@ -This is a common line +This is a common line.

is very similar to the output diff -ru produces:

qwurx [shmem] ~/tmp/diff> diff -ur test1 test2 diff -ur test1/common/common.txt test2/common/common.txt --- test1/common/common.txt 2017-03-09 12:28:15.215474776 +0100 +++ test2/common/common.txt 2017-03-09 12:28:38.639837796 +0100 @@ -1 +1 @@ -This is a common line +This is a common line. Only in test2/common: common.txt~ Only in test1: different1 Only in test2: different2

and it is trivial to filter that output to resemble that of your script.
Perhaps you want to tell us what kind of output you are aiming for, and the purpose of it all?

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1184022]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found