Skip to content

Commit

Permalink
tac: strict.pm coverage (#467)
Browse files Browse the repository at this point in the history
* The code at beginning of file was not covered by "strict"
* When adding strict at top of file, %opts was not in global scope
* This patch fixes a bug where options such as -s SEP were being ignored
  • Loading branch information
mknos committed Feb 29, 2024
1 parent b7fbd33 commit 27736f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/tac
Expand Up @@ -16,6 +16,8 @@ License: perl
# tac - concatenate and print files in reverse
#

use strict;

use File::Basename qw(basename);
use Getopt::Std qw(getopts);

Expand All @@ -25,7 +27,8 @@ use constant EX_FAILURE => 1;
my $Program = basename($0);
my $VERSION = '0.18';

unless (getopts('bBrs:S:', \my %opts)) {
my %opts;
unless (getopts('bBrs:S:', \%opts)) {
warn "$Program version $VERSION\n";
warn "usage: $Program [-br] [-s separator] [-B] [-S bytes] [file...]\n";
exit EX_FAILURE;
Expand Down

0 comments on commit 27736f9

Please sign in to comment.