in reply to Re: Count array element in HASH of ARRAYS
in thread Count array element in HASH of ARRAYS

Just curious: Are the
    $containers{$con} = [ ] if !exists $containers{$con};
or
    $containers{$con} = 0 if !exists $containers{$con};
statements strictly (or warnings-ly) necessary with your Perl version? They aren't with 5.8.9 and 5.14.4 — but they certainly do no harm in any case.


Give a man a fish:  <%-(-(-(-<

Replies are listed 'Best First'.
Re^3: Count array element in HASH of ARRAYS
by halfcountplus (Hermit) on Jul 20, 2015 at 14:42 UTC
    Seems they aren't necessary even with strict, no. I'm just prone to:
    use paranoid qw(really really);
    Which is not to say it's a good thing. In fact I'll take those out...they might be taken to improve readability or something but not significantly IMO.
Re^3: Count array element in HASH of ARRAYS
by stm (Initiate) on Jul 20, 2015 at 14:23 UTC
    $containers{$con} = 0 if !exists $containers{$con};

    Above one works. Statement "Strictly" is in use and perl version is 5.10.1, no error / warning