in reply to Need help to fine tune perl script to make it faster( currently taking more than 30 minutes)
This checks for matching lines and pulls the record number out at the same time.../Record(\d+):/ && do { $recnum = $1; s/$str1/$str2/g; s/$str3/$str4/g; .. }
Note that the regex in the above may not be quite right as your original seems to back up 6 characters from the ':', but the regex can be amended to do that too.
|
|---|