#!/usr/bin/env perl use strict; use warnings; use Carp; # Get the name of the file on which to do the tidydiff on my $file = $ARGV[0]; die "Usage: $0 \n" if !defined($file); # Check if the file is a plain file. If it's not then it's obviously # not perl code. die "'$file' is not a plain file\n" if !-f $file; # Check if the file is readable to us. die "Insufficient permissions to read file: '$file'\n" if !-R $file; print `perltidy $file | diff $file - `;