On Mon, Aug 11, 2014 at 11:10:59AM +0200, Tom de Vries wrote:
> +use File::Temp;
> +use File::Copy qw(cp mv);

> +     # Copy the permissions to the temp file (in perl 2.15 and later).
> +     cp $diff, $tmp or die "Could not copy patch file to temp file: $!";

That's File::Copy 2.15, not Perl 2.15 (which doesn't exist).  File::Copy 2.15
isn't so terribly old, so you might want to do a version check, e.g. as

use File::Copy 2.15 qw/cp mv/;

(but it's in Perl 5.10 already, so you might not want to bother).

> -if ($#ARGV != 0) {
> +$inline = 0;
> +if ($#ARGV == 1 && ("$ARGV[0]" eq "-i" || "$ARGV[0]" eq "--inline")) {
> +     shift;
> +     $inline = 1;
> +} elsif ($#ARGV != 0) {

If you want any more command-line options, have a look at Getopt::Long.


Segher

Reply via email to