Instead of hardcoding the location of perl (assuming it is installed in
/usr), use /usr/bin/env to run it, and thus picking it from $PATH.
This makes it possible to run these scripts also on installations with
perl in a different prefix than /usr.
Also, given that we want enable warnings on scripts, turn the -w
previously in shebang to explicit "use warnings;" in scripts which
didn't have it before.
(This is the same change as d98c9c0e0b4d259f49825fc360bc7e6cafbdd644
in libguestfs.)
---
extra-tests/fuzz.pl | 3 ++-
extra-tests/insert-keys.pl | 3 ++-
regedit/hivexregedit | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/extra-tests/fuzz.pl b/extra-tests/fuzz.pl
index 46e77fd..0e8f254 100755
--- a/extra-tests/fuzz.pl
+++ b/extra-tests/fuzz.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
# hivex extra tests
# Copyright (C) 2014 Red Hat Inc.
#
@@ -20,6 +20,7 @@
# crash on the fuzzed hives, not that it can read them.
use strict;
+use warnings;
use File::Temp qw(tempfile);
use File::Copy;
diff --git a/extra-tests/insert-keys.pl b/extra-tests/insert-keys.pl
index 1124b37..b3d6a18 100755
--- a/extra-tests/insert-keys.pl
+++ b/extra-tests/insert-keys.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
# hivex extra tests
# Copyright (C) 2013 Red Hat Inc.
#
@@ -21,6 +21,7 @@
# get the expected data and don't get any errors.
use strict;
+use warnings;
use Win::Hivex;
diff --git a/regedit/hivexregedit b/regedit/hivexregedit
index 0e534de..6b31a3a 100755
--- a/regedit/hivexregedit
+++ b/regedit/hivexregedit
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
# Copyright (C) 2010-2011 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
--
2.1.0