Global symbol "%hash" requires explicit package name at test_do_archiv +e2.pl line 68. Global symbol "%hash" requires explicit package name at test_do_archiv +e2.pl line 70. Global symbol "%hash" requires explicit package name at test_do_archiv +e2.pl line 72. Global symbol "@array" requires explicit package name at test_do_archi +ve2.pl line 79. Execution of test_do_archive2.pl aborted due to compilation errors.
#!/usr/bin/perl -w use strict; use Getopt::Long; use UUID::Tiny; use Sys::Syslog qw( :DEFAULT setlogsock); use POSIX qw/strftime ceil/; use Storable qw/dclone/; use Digest::SHA qw/hmac_sha256 hmac_sha256_hex/; use LWP; use DBI; use File::stat; use HTTP::Request::Common qw/POST/; use LWP::UserAgent::Determined; delete @ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; use sigtrap 'handler' => \&term_handler, 'normal-signals'; # Gen Config # GETOPT my $verbose; my $datalist; GetOptions ('verbose!' => \$verbose, "datalist=s" => \$datalist); # Term Hanlder sub term_handler { doLog("err","term_handler: Program terminated early due to user in +put"); exit 2; } # DATE STUFF $ENV{TZ} = "Z"; my @systime = localtime(); # Log sub sub doLog { my ($priority,$msg) = @_; return 0 unless ($priority =~ /info|err|debug/); setlogsock('unix'); openlog("do_archive.pl", 'pid,cons', 'user'); syslog($priority, $msg); closelog(); return 1; } # Debug sub doDebug { my ($header,$content) = @_; if ($verbose) { doLog("debug",$header.": ".$content); print "################".$header."#################\n".$content."\ +n"."##################################\n"; } } # String Trim sub doStringTrim { my $string=shift; $string =lc($string); $string=~s/^\s+//; $string=~s/\s+$//; return $string; } sub doHashTidy { my $hash=shift; foreach my $k (keys %{hash}) { my $kv=doStringTidy($k); my $vv=doStringTidy($hash{$k}); delete $hash->{$k}; $hash{$kv} = $vv; } } #ArrayTidy sub doArrayTidy { my($array) = @_; foreach (@{array}) { $_=lc($_); s/^\s+//; s/\s+$//; } } my %hash=("X"," t "); doHashTidy(\%hash); foreach my $key ( keys %hash ) { print "key:$key, value:$hash{$key}\n"; }

In reply to Re^4: Strictly frustrating ! by PearlsOfWisdom
in thread Strictly frustrating ! by PearlsOfWisdom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.