[Boulder.pm] Boulder-pm Digest, Vol 41, Issue 1
Gaurav Vaidya
gaurav at ggvaidya.com
Fri Feb 14 19:20:01 PST 2014
Hullo!
On 14 Feb, 2014, at 1:00 pm, boulder-pm-request at pm.org wrote:
> Quicky here. I'm processing logs do not necessarily know the MAC's of IP's
> I'm looking to find usage for. Right now I'm doing this:
>
>
>
> $Usage{$MAC}=0 if ( ! $Usage{$MAC} );
> $Usage{$MAC}=$Usage{$MAC}+$NewUsage;
>
>
> I could have swore there was a way to say something along the line of just
> set $Usage{$MAC} to Zero if it's not defined. Without turning off warnings
> is my goal.
You might be thinking of the “logical defined-or” operator: http://perldoc.perl.org/perlop.html#Logical-Defined-Or
I think you could track your usage counts like this: https://gist.github.com/gaurav/9014086
Hope that helps!
cheers,
Gaurav
More information about the Boulder-pm
mailing list