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

Hi all, I am trying to write a script that will use diff. I have looked at the CPAN diff version and just do not like it as much, is there a way to use the GNU version of diff in a PERL Script? Thanks!

Replies are listed 'Best First'.
Re: Using GNU diff in a PERL Script
by morgon (Priest) on May 19, 2009 at 15:30 UTC
    my $diff = qx| diff file1 file2 |;
    Another syntax would be using backticks - see perldoc perlop.
Re: Using GNU diff in a PERL Script
by Bloodnok (Vicar) on May 19, 2009 at 17:36 UTC
    Which specific diff on CPAN do you not like - I found several candidates...some of which are (claimed to be) compatible with patch.

    A user level that continues to overstate my experience :-))
Re: Using GNU diff in a PERL Script
by ambrus (Abbot) on May 20, 2009 at 07:52 UTC