[Bro] script question

Dk Jack dnj0496 at gmail.com
Wed Nov 9 12:05:12 PST 2016


yeah, was surprised a little since it goes against the scoping rules of
most languages I've dealt with scripting or otherwise...
Perhaps an update to documentation would be helpful...

Bhasker.


On Tue, Nov 8, 2016 at 11:09 PM, Vern Paxson <vern at berkeley.edu> wrote:

> > Found an interesting quirk of bro scripting. Not sure if its a quirk or a
> > bug.
>
> It's a quirk actually, by which I mean known behavior since I implemented
> local variables way back 'n the day.  The philosophical view may have been
> that it's confusing to have the same variable name mean different things
> inside the same function, so good to avoid that; but I might have done it
> simply for implementation convenience, I don't recall which at this point.
>
> Given that it's surprising behavior, and arguably not particularly
> beneficial,
> I wouldn't mind changing it.
>
>                 Vern
>
>
> > function myfunction()
> > {
> >     if (T) {
> >         local var = "Hello, World!";
> >         print var;
> >     } else {
> >         local var = "Goodbye, World!";
> >         print var;
> >     }
> > }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20161109/2e780eb6/attachment.html 


More information about the Bro mailing list