diff options
Diffstat (limited to 'ext/Digest/SHA/t/2-nist-vectors-byte.t')
-rw-r--r-- | ext/Digest/SHA/t/2-nist-vectors-byte.t | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/Digest/SHA/t/2-nist-vectors-byte.t b/ext/Digest/SHA/t/2-nist-vectors-byte.t index 32dfb7c858..3a0d0b4f5a 100644 --- a/ext/Digest/SHA/t/2-nist-vectors-byte.t +++ b/ext/Digest/SHA/t/2-nist-vectors-byte.t @@ -23,9 +23,8 @@ my @hashes; BEGIN { my $file = File::Spec->catfile(dirname($0), "nist", "byte-hashes.sha1"); - my $datafile = File::Spec->canonpath($file); - open(F, $datafile); - while (<F>) { + open(my $fh, q{<}, $file); + while (<$fh>) { next unless (/^[0-9A-F]/); s/[\r\n]+$//; if (/\^$/) { @@ -33,7 +32,7 @@ BEGIN { push(@hashes, $_); } } - close(F); + close($fh); plan tests => scalar(@hashes); } @@ -61,9 +60,8 @@ my $type3 = 0; my $ctx = Digest::SHA->new(1); my $file = File::Spec->catfile(dirname($0), "nist", "byte-messages.sha1"); -my $datafile = File::Spec->canonpath($file); -open(F, $datafile); -while (<F>) { +open(my $fh, q{<}, $file); +while (<$fh>) { $type3 = 1 if (/Type 3/); $type3 = 0 if (/^<D/); next unless (/^[0-9^ ]/); @@ -86,4 +84,4 @@ while (<F>) { $line = ""; } } -close(F); +close($fh); |