Think about Loose Coupling | |
PerlMonks |
Re: regexp with Hash doutby InfiniteSilence (Curate) |
on Apr 10, 2014 at 14:35 UTC ( [id://1081821]=note: print w/replies, xml ) | Need Help?? |
When I push the timing files to separate files and run each of them against your script using the debugger I notice that it runs twice for the first file but only once for the second:
Simple analysis of what is in $_ immediately after Line 11 reveals that it contains everything up to the second record. With the second timing file the same thing shows you the entire file. Therefore, your record separator is not matching correctly. If you change your code to the following it should work:
You'll notice that I made two changes to your code. 1) I changed the record separator from "\nStartpoint" to just "Startpoint" and 2) I wrapped your regular expression in an if statement. My recommendations for you going further are as follows:
Celebrate Intellectual Diversity
In Section
Seekers of Perl Wisdom
|
|