about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-06-14 03:46:32 +0530
committerAndinus <andinus@nand.sh>2020-06-14 03:46:32 +0530
commit899a3e67167843904edcbf0d6c1a6e7ab4619b6f (patch)
treefd7339721a33fcaeeda88a28d4fe60aa77e98560
parentb7784f7a14ca75a9f2d86572b6b60211aad78e41 (diff)
downloadara-899a3e67167843904edcbf0d6c1a6e7ab4619b6f.tar.gz
Document a line, ignoring a warning
It would've printed something like:

  Name "HTTP::Simple::UA" used only once: possible typo at
  /home/andinus/projects/scripts/ara line 121.

  Error in tempfile() using template
  https:/api.covid19india.org/XXXXXXXXXX: Parent
  directory (https:/api.covid19india.org/) does not exist at
  /home/andinus/perl5/lib/perl5/HTTP/Simple.pm line 69.

Grinnz on #perl (freenode.net) said:

  probably because HTTP::Simple isn't loaded until runtime, that
  warning is pretty stupid

  it's a workaround for before they had proper lexical variables to
  work with that can detect typoes correctly
-rwxr-xr-xara.pl1
1 files changed, 1 insertions, 0 deletions
diff --git a/ara.pl b/ara.pl
index 7836f6f..1b34e93 100755
--- a/ara.pl
+++ b/ara.pl
@@ -119,6 +119,7 @@ if ( not $use_local_file
                or $get_latest ) ) {
     require HTTP::Simple;
 
+    # Ignore a warning, next line would've printed a warning.
     no warnings 'once';
     $HTTP::Simple::UA->verify_SSL(1);