in reply to Performance issue
You might want to get acquainted with Benchmark, and then maybe use that to compare alternate approaches. To use it effectively, you'll want to rethink your subroutine so that it's more "atomic" (independent, modular), which will be a Good Thing.
You might also consider split as an alternative to regex matching with captures. Based on the data shown, something like this would suffice:
I don't recall off-hand what sort of timing difference this might yield (but Benchmark would be a good way to find out).$str = "mycompany----engineer=====itdept-----33"; my @pieces = split /\W+/, $str;
Maybe the stuff that your "Extract" sub is doing could be done without a sub call, and that might save some time (along with getting rid of the unnecessary print statements).
|
|---|