Hello,

How does one update a hash element in PERL?

I am using anonymous hashes to process a file, and each element in the
anonymous has its own value...  

If the file has success on process, I delete the hash element from the
anonymous hash...  

If it the file fails to process, I need to increment the attempts to the
next higher number...  

I tried this,

If ($HASH{KEY}->{attempts} != '5') {

        $attempted = $HASH{KEY}->{attempts} + '1';

        $HASH{KEY}->{attempts} => $attempted; #Update the hash key

} else {

        Move the file to the error folder...  
        
}

When I run it, I get "Useless use of hash element in void context.
Useless use of private variable in void context...

How could this better be written?

-Dan

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to