[Bro] A problem during using 'set'

Asma Mumtaz asma.mtz at gmail.com
Sun May 13 03:10:03 PDT 2012


And the problem remains same, even if I use 'table[count] of count'.

regards,
Asma

On Sun, May 13, 2012 at 2:55 PM, Asma Mumtaz <asma.mtz at gmail.com> wrote:

> Hi,
>
> I was testing my code written in Bro, and I was noticing some wrong
> values. When I debugged the code, the following section had the problem
> (the bold part)
>
> if(vals[index2] == "length"){
>                 local length_vals = split(vals[index2 + 1], /-/);
>                 *local lengths: set[count];*
>                 *print cat("here - prev length = ", |lengths|);*
>                 for(index3 in length_vals)
>                     if(length_vals[index3] != "") add
> lengths[to_count(length_vals[index3])];
>                 *print |lengths|;*
>             } #finished lengths
> here is the output.
>
> here - prev length = 0
> 1
> here - prev length = 1
> 2
> here - prev length = 2
> 3
> here - prev length = 3
> 4
> here - prev length = 4
> 31
> here - prev length = 31
> 34
> here - prev length = 34
> 46
> here - prev length = 46
> 48
>
> It means that whenever I declare local lengths: set[count]. It is not
> initializing a new 'set', but keeps the state of previous set of values
> entered and updated it. Why is it doing so?
> regards,
> Asma
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20120513/b09f8bbd/attachment.html 


More information about the Bro mailing list