scripts: xxdi.pl: remove File::Slurp dependency
[openwrt/staging/dedeckeh.git] / scripts / xxdi.pl
index acc974c4b3cc8316001a28b12f41e9f581eac36f..1f960902beffd56f49ae1a378e69b6018cd0adc2 100755 (executable)
 
 use strict;
 use warnings;
-use File::Slurp qw(slurp);
 
-my $indata = slurp(@ARGV ? $ARGV[0] : \*STDIN);
+my $indata;
+
+{
+       local $/;
+       my $fh;
+
+       if (@ARGV) {
+               open($fh, '<:raw', $ARGV[0]) || die("Unable to open $ARGV[0]: $!\n");
+       } else {
+               $fh = \*STDIN;
+       }
+
+       $indata = readline $fh;
+
+       close $fh;
+}
+
 my $len_data = length($indata);
 my $num_digits_per_line = 12;
 my $var_name;