I have been using an auditing script which is a cgi for months now all working fine and dandy. One of the subroutines pulls back mcafee AV Info from the registry. Suddenly its stopped working and producing the error, although the only thing i have done is added a few subroutines further down the code !!! What can this be refering to ? Code Below:- edited by boo_radley : added readmore tag
sub mcafee { # carry out Reg Query and action as required use Win32::TieRegistry ( Delimiter=>"/", ArrayValues=>1 ); $Registry->Delimiter("/"); # Set delimiter to "/". $remKey= $Registry->Connect( "$server", "LMachine", { Access=>KEY_READ +,Delimiter=>"/" } ); $regkey = $remKey->{"Software/network associates/tvd/netshield nt/curr +entversion/szenginever"}; # print "@$regkey[0]\n"; # Print it (note it is a reference to an a +rray -hence the @$)uncomment for bug fixing print "ANTI VIRUS INFORMATION: \n"; print "------------------------"; print "\nNetshield Anti Virus Engine Version $regkey\n"; # Pri +nt it (note it is a reference to an array -hence the @$) # Get the location where the upgrade will come from $Registry->Delimiter("/"); # Set delimiter to "/" +. $remKey= $Registry->Connect( "$server", "LMachine/", { Access=>KEY +_READ,Delimiter=>"/" } ); # Connect to remote registry $regkey= $remKey->{"Software/network associates/tvd/netshield nt/c +urrentversion/tasks/upgrade//szupdateunclocation"}; $upguser= $regkey->{"Software/network associates/tvd/netshield nt/ +currentversion/tasks/upgrade//szrunasuser"}; print "Engine Update Source Server $regkey. Using this account - +$upguser\n"; # get dat file version $Registry->Delimiter("/"); $remKey= $Registry->Connect( "$server", "LMachine/", { Access=>KEY +_READ,Delimiter=>"/" } ); # Connect to remote registry $regkey= $remKey->{"software/network associates/tvd/netshield nt/c +urrentversion//szvirdefver"}; print "\nVirus Definition file version $regkey\n"; # get dat file date $Registry->Delimiter("/"); $remKey= $Registry->Connect( "$server", "LMachine/", { Access=>KEY +_READ,Delimiter=>"/" } ); # Connect to remote registry $regkey= $remKey->{"software/network associates/tvd/netshield nt/c +urrentversion//szvirdefdate"}; print "Virus Definition file date $regkey\n"; # Get the location where the update comes from .. $Registry->Delimiter("/"); $remKey= $Registry->Connect( "$server", "LMachine/", { Access=>KEY +_READ,Delimiter=>"/" } ); # Connect to remote registry $regval= $remKey->{"software/network associates/tvd/netshield nt/c +urrentversion/tasks/update//szupdateunclocation"}; $upduser= $remKey->{"software/network associates/tvd/netshield nt/ +currentversion/tasks/update//szrunasuser"}; print "Virus Update definition file source $regval . Using this a +ccount - $upduser\n"; # Get Alerter info. $Registry->Delimiter("/"); $remKey= $Registry->Connect( "$server", "LMachine/", { Access=>KEY +_READ,Delimiter=>"/" } ); # Connect to remote registry $regval= $remKey->{"software/network associates/tvd/shared compone +nts/alert manager/recipients//recipient0"}; print "\nVirus Alerts:\n"; print "-------------"; print "\nAnti Virus Alert recipient 0 set to: $regval: "; $regval= $remKey->{"software/network associates/tvd/shared compone +nts/alert manager/recipients//recipient1"}; print "\nAnti Virus Alert recipient 1 set to: $regval: "; $regval= $remKey->{"software/network associates/tvd/shared compone +nts/alert manager/recipients//recipient2"}; print "\nAnti Virus Alert recipient 2 set to: $regval: "; # Get Scheduler Info. print "\n\nScheduler Info\n"; print "--------------\n"; $Registry->Delimiter("/"); $remKey= $Registry->Connect( "$server", "LMachine/", { Access=>KEY +_READ,Delimiter=>"/" } ); # Connect to remote registry $regval= $remKey->{"software/network associates/tvd/Netshield NT/C +urrentVersion/Tasks/Update//bSchedEnabled"}; if ($regval=="0x00000001") { $schedenabled="Yes"; } else { $schedenabled="No"; } print "Update Scheduler enabled: $schedenabled\n"; # Get Upgrade Sched info $Registry->Delimiter("/"); $remKey= $Registry->Connect( "$server", "LMachine/", { Access=>KEY +_READ,Delimiter=>"/" } ); # Connect to remote registry $regval= $remKey->{"software/network associates/tvd/Netshield NT/C +urrentVersion/Tasks/Upgrade//bSchedEnabled"}; if ($regval=="0x00000001") { $schedenabled="Yes"; } else { $schedenabled="No"; } print "Upgrade Scheduler enabled: $schedenabled\n"; }

In reply to Weird Error:Can't coerce array into hash by Anonymous Monk

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.