Do you know where your variables are? | |
PerlMonks |
Re: Not able to capture informationby Marshall (Canon) |
on Feb 17, 2012 at 06:51 UTC ( [id://954418]=note: print w/replies, xml ) | Need Help?? |
This idea didn't work out as well as I thought it would, but I will post for entertainment value. There are a lot of ways to skin these cats...
Update: I suppose the first two little regex's in the map could be replaced with a single tr @data = map{ tr/\n[/ /d; s/\]/ ==/g; $_}@data; tr is faster than regex because it is "lighter weight" meaning "dumber". It cannot substitute one character into two. But in this case performance appears not to be a significant factor - or at least that is not mentioned in the requirements. My personal advice on parsing very regular program generated things like log files is to keep the regex complexity as low as possible - make it just as complicated as it needs to be and no more. If you are validating "user input" then the complexity level has to be more.
In Section
Seekers of Perl Wisdom
|
|