Skip to content

Commit

Permalink
scripts: xxdi.pl: remove File::Slurp dependency
Browse files Browse the repository at this point in the history
In order to make it more portable.

Signed-off-by: Jo-Philipp Wich <[email protected]>
Signed-off-by: Petr Štetiar <[email protected]>
  • Loading branch information
jow- authored and ynezz committed Sep 6, 2022
1 parent 2117d04 commit 8b278a7
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions scripts/xxdi.pl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,24 @@

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;
Expand Down

0 comments on commit 8b278a7

Please sign in to comment.