in reply to How to disable:Odd number of elements in hash assignment warning?

I think disabling warnings for this kind of thing is perfectly fine but this occurs to me as an alternative; not expressing a preference–

sub crommulate { push @_, undef if @_ % 2; my %bingo = @_; # ... }
  • Comment on Re: How to disable:Odd number of elements in hash assignment warning?
  • Download Code

Replies are listed 'Best First'.
Re^2: How to disable:Odd number of elements in hash assignment warning?
by BrowserUk (Patriarch) on Sep 23, 2016 at 19:15 UTC

    In general I don't see the point in doing extra work to avoid a warning I can simply disable. Especially when, as in this case, the affected code is processing 10s or 100s of millions of records.

    I could, use tr[] or m[] to count the number of delimiters and then the 3rd arg to split to avoid the odd number of returned values, but since the split is already the most costly (cpu) operation, doing the same work twice to avoid a warning I can disable, would be a waste of cycles.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.