ilans11il has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'd like to compare 2 files ,with comm command using and array for the file name

foreach my $var (@varaints) { push @filesToCompre , &Get_Affected_Files_Contents($fullPath,$filePatt +ern,$var,$PackDir); `comm -13 $filesToCompre[0] $filesToCompre[1] |egrep -v "$IgnoreFiles +" > $Diff_File_64_64OG`; sub Get_Affected_Files_Contents { `less $fullPath/$filePattern | awk '{print \$4}' | egrep -v "$IgnoreFi +les" | cut -d\/ -f6- -s | sort > $Affected_fileName`; } }

Replies are listed 'Best First'.
Re: comparing 2 files using array
by karlgoethebier (Abbot) on Jan 16, 2014 at 13:19 UTC
Re: comparing 2 files using array
by Anonymous Monk on Jan 16, 2014 at 13:36 UTC
    You seem to be writing a shell script with Perl. Why not drop Perl from the equation?

    /me shudders at a terminal pager getting used as a Useless Use of Cat^H^H^H Less