Skip to content

Commit

Permalink
awk refuses to use a2p (#524)
Browse files Browse the repository at this point in the history
* My Linux system has perl 5.32.1, and I installed App::a2p under it using cpanm
* Now my system has /usr/local/bin/a2p command available
* I built a newer version of perl; now one perl has App::a2p and the other doesn't
* This version of awk does not use App::a2p, it only runs the command a2p
* The SANITY check was not sane in my case because both perls are able to run a2p, but the awk wrapper refuses on one perl because of App::a2p check
* Delete the SANITY code; there is already a check if a2p failed to run so this is good enough
* Also remove the too-helpful error check for long options; users will still see "unknown flag" error which unambiguously states that the option can't be used
  • Loading branch information
mknos committed Mar 27, 2024
1 parent 512139e commit 3c7b007
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions bin/awk
Expand Up @@ -17,12 +17,6 @@ License: perl

use strict;

SANITY: {
my $external_module = 'App::a2p';
my $rc = eval "require $external_module; $external_module->import; 1";
die "This program needs the $external_module module.\n" unless $rc;
}

my(
$program, # the code to eval
$tmpin, # the files a2p reads
Expand Down Expand Up @@ -81,11 +75,6 @@ while (@ARGV) {
push(@nargs, $_);
last;
}
elsif (s/^-//) {
if (length) { usage("Long options not supported") }
shift;
next;
}
else {
usage("unknown flag: -$_");
}
Expand Down

0 comments on commit 3c7b007

Please sign in to comment.