in reply to Using GNU diff in a PERL Script

my $diff = qx| diff file1 file2 |;
Another syntax would be using backticks - see perldoc perlop.