The suggestion from roboticus is a good one.
I'd like to add to that a more general suggestion. When you have a performance problem, there are tools available to help tell where the problem is. Using Devel::DProf or Devel::Profile, you can get profiling data on a per-sub basis. For a tutorial, see Profiling your code.
For something like what you have, where there aren't many subs, just a short program of lines, Devel::NYTProf and Devel::SmallProf are more appropriate tools.
Try them out. You may be surprised at what they show (I usually am).
In reply to Re: Increase speed script
by kyle
in thread Increase speed script
by marto9
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |