On 08/11/2014 11:22 AM, Tom de Vries wrote:
+if ($#ARGV == 1 && ("$ARGV[0]" eq "-i" || "$ARGV[0]" eq "--inline")) {
I'd do >= 1 but that's a question of personal preference.
What is the purpose of that proposed change ?
Kind of laying foundation for adding more flags in the future. But as I
said, this could be done as need for new flags arises.
I'm now using mktemp from File::Temp.
The script now relies on external Perl modules. This is probably fine
because AFAIK File::Temp and File::Copy are available included in all
distributions.
+use File::Copy "cp";
+use File::Copy "mv";
You could trade one line with qw(cp mv)...
+ $tmp = mktemp("tmp.XXXXXXXX") or die "cannot create temp file: $!";
Perhaps "Could not" like in other error messages?
+ cp "$diff", "$tmp" or die "Could not copy patch file to temp file: $!";
Script don't quote stuff in other places so quoting here is useless.
-Y