On 10/03/2012 02:07 AM, Boyles, Gary P wrote:
> All,
>
> I’ve got this simple rule, and I keep getting the error…
>
> *Use of uninitialized value $node in exists at (eval 13) line 1.*
>
> Here is the rule. Any obvious errors you can see?

After having a quick look into the function, the following fragment 
caught the eye:

@pLine = split(/\s+::\s+/, $_[0]);
$node  = $pLine[3];

The problem is that if @pLine is an array with less that 4 elements, 
then $pLine[3] would not exist, and $node would be set to 'undef'.

I'd recommend to change the line

if (exists $nodeSuppress{$node})

to

if (defined($node) && exists $nodeSuppress{$node})

That will verify that we would always do a hash lookup for a key which 
is defined, and would avoid the warning message you are seeing.

Hope this helps,
risto

>
> This is my 1^st attempt at using perlfunc with pattern. Not sure if I’m
> doing it right.
>
> Thanks.
>
> Gary Boyles
>
> type=Single
>
> continue=DontCont
>
> ptype=perlfunc
>
> pattern=sub { \
>
> my(@pLine) = (); \
>
> my($node) = "0"; \
>
> @pLine = split(/\s+::\s+/, $_[0]); \
>
> $node = $pLine[3]; \
>
> if (exists $nodeSuppress{$node}) \
>
> { return 1; } \
>
> else \
>
> { return 0; } \
>
> }
>
> desc=NodeAndClassSuppress -- $0
>
> action=write /sec/log/sec.main.log %s
>
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
>
>
>
> _______________________________________________
> Simple-evcorr-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to