[Boulder.pm] Adding undefined variables?

Robert L. Harris robert.l.harris at gmail.com
Fri Feb 14 11:11:47 PST 2014


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.


Anyone know a better or cleaner way to do this?

Robert


-- 
:wq!
---------------------------------------------------------------------------
Robert L. Harris

DISCLAIMER:
      These are MY OPINIONS             With Dreams To Be A King,
       ALONE.  I speak for                      First One Should Be A Man
       no-one else.                                     - Manowar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/boulder-pm/attachments/20140214/9057d25f/attachment.html>


More information about the Boulder-pm mailing list