in reply to Re^2: notequal very slow
in thread notequal very slow

Cut the code down to just the loop, remove whatever you can, see if it's still slow. if it's not, the problem is in the code you removed. if it's still slow, post the remaining code here.

update: what BrowserUk said, especially the part about output buffering: print statements are not generally a reliable way to measure timing (though you could include the current millisecond time, as given by Time::Hires in your debugging line, which should give you a reasonable indication), but even then, the if(...) statement you posted should probably take a lot less time to execute than printing a line to stdout.