Hmmm... interesting. Tested on three computers: XP/IE 6 Perl 5.8 (friend), Win2K sp3 IE 5.5 (home), and Win2K sp3 IE 6 (work). It worked as advertised on all three.
According to MSDN, the NewWindow2 event is fired before every new window opened. Are you sure you're using the IE window opened by the script? It will print the URL of every site that tries to open a new window and the script should stop when you close that window.
Anyway, it was useful for it's purpose. I use Mozilla as my everyday browser, so I never see an unwanted popup.