scripts: xxdi.pl: remove File::Slurp dependency
In order to make it more portable. Signed-off-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
parent
2117d04a3a
commit
8b278a76d9
1 changed files with 17 additions and 2 deletions
|
@ -14,9 +14,24 @@
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
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 $len_data = length($indata);
|
||||||
my $num_digits_per_line = 12;
|
my $num_digits_per_line = 12;
|
||||||
my $var_name;
|
my $var_name;
|
||||||
|
|
Loading…
Reference in a new issue