From: Steve Hancock Date: Mon, 30 Dec 2024 18:18:00 +0000 (-0800) Subject: add comment X-Git-Tag: 20250105~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3dc98de60bdfe3c29d309cf34e188ab19ac9a364;p=perltidy.git add comment --- diff --git a/examples/dump_unique_keys.pl b/examples/dump_unique_keys.pl index cdd1176e..d5b771d3 100755 --- a/examples/dump_unique_keys.pl +++ b/examples/dump_unique_keys.pl @@ -7,6 +7,16 @@ use File::Temp qw{ tempfile }; # show hash keys which just appear in one file. # Requires Perl::Tidy version 20240903.09 or higher +# The latest version of this file should be at: +# https://github.com/perltidy/perltidy/blob/master/examples/dump_unique_keys.pl + +my ( $fh_tmp, $tmpfile ); +END { + if ( defined($tmpfile) && -e $tmpfile ) { + unlink($tmpfile) or warn "Could not unlink $tmpfile: $!"; + } +} + main(); sub main { @@ -33,7 +43,7 @@ EOM if ( !-e $file ) { die "file '$file' not found\n" } } - my ( $fh_tmp, $tmpfile ) = tempfile(); + ( $fh_tmp, $tmpfile ) = tempfile(); if ( !$fh_tmp ) { die "unable to open temporary file $tmpfile\n"; } @@ -82,11 +92,6 @@ EOM print {*STDOUT} $output_string; - END { - if ( defined($tmpfile) && -e $tmpfile ) { - unlink($tmpfile) or warn "Could not unlink $tmpfile: $!"; - } - } } ## end sub main sub read_MANIFEST {