[Omaha.pm] silly warnings

Theodore Katseres tedkat at gmail.com
Thu Jan 15 08:41:35 PST 2009


On Thu, Jan 15, 2009 at 10:08 AM, Dan Linder <dan at linder.org> wrote:

> On Wed, Jan 14, 2009 at 4:32 PM, Dan Linder <dan at linder.org> wrote:
> > Another thought I had: Is it possible to "define $hash{$key}" manually
> > without assigning a value to it?  (i.e. the opposite of "undef
> $hash{$key}")
>
>>
> On Wed, Jan 14, 2009 at 4:54 PM, Theodore Katseres <tedkat at gmail.com>wrote:
> > Yes but a warning will pop up in it's place "Useless use of hash element
> in void context"
>
> IIRC, I ran across that using the "($hash{$key} || 0);" idea.
>
> Later:
> > Make sure that each var in the hash key is defined.
>
> I'd like to, but the keys are coming in as a file is processed and the keys
> come directly from the file.
>
> I'll try defining the new key one step at a time and see what that
> produces.
>
> Later:
> >  That will take care of the warnings but it might hide a bug too :P
>
> I know there's a few options that can be appended to the "use strict" line
> - which one will apply to this hash key issue?  My Google search term MoJo
> isn't finding the information.


 If you just want to turn warnings off the best you could get without
re-coding the block
would be to add C<no warnings;> after line 55.

-- 
Ted Katseres
     ||=O=||
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/omaha-pm/attachments/20090115/06fe826d/attachment-0001.html>


More information about the Omaha-pm mailing list