http://www.perlmonks.org?node_id=517168


in reply to Re: Using IF and OR, I'm sure there is a better way
in thread Using IF and OR, I'm sure there is a better way

I'd recommend trying this vs seperate elsif statements on a large file and seeing if it makes a difference.

6 weeks ago I was optimising a process reading in a daily network syslog file of approx 1200 MB using 5.8.0 on an overworked Ultra 2 running Solaris 2.6.

The script had been using next if (/abc|cde|fgh|/) which *looks* most concise, but I found (to my and my workmate's surprise) that replacing it with the equivalent elsif statements made it take about 30 seconds less (it had been taking >2 minutes to read the file in).