sub win32_ie_events { my( $agent, $event, @args ) = @_; $events_ok++ or init_win32_ie_events(); $t_last_event = gettimeofday(); CASE: { # NON RELEVANT CODE DELETED $event eq 'NewWindow3' and do { my $pu = Win32::OLE->new('InternetExplorer.Application')->{Application}; #Win32::OLE->WithEvents( $pu, \&win32_ie_events, 'DWebBrowserEvents2' ); $args[0]->Put($pu); } } my $te = sprintf '%6.2f', $t_last_event - $t_start; print "$te $agent $dl_cnt $dl_tot [$event]\n"; }