Replace working directory guess with FindBin

This commit is contained in:
Dan Church 2022-11-11 17:09:32 -06:00
parent f8c4c19dcd
commit e80b115e74
Signed by: h3xx
GPG key ID: EA2BF379CD2CDBD0

View file

@ -18,7 +18,7 @@ use strict;
use warnings; use warnings;
use Getopt::Long qw/ GetOptions :config no_ignore_case /; use Getopt::Long qw/ GetOptions :config no_ignore_case /;
use File::Basename qw/ dirname /; use FindBin qw//;
my %domains; my %domains;
my $dupes = 0; my $dupes = 0;
@ -69,7 +69,7 @@ sub add_host_file {
MAIN: { MAIN: {
my $out; my $out;
my $block_ip = '0.0.0.0 ::1'; my $block_ip = '0.0.0.0 ::1';
my $workdir = &dirname($0); my $workdir = $FindBin::RealBin;
unless (&GetOptions( unless (&GetOptions(
'out=s' => \$out, 'out=s' => \$out,