laziness, impatience, and hubris | |
PerlMonks |
Re^3: Suggestions to make this code more Perlishby kcott (Archbishop) |
on Mar 31, 2014 at 13:00 UTC ( [id://1080393]=note: print w/replies, xml ) | Need Help?? |
Thanks for taking the time to study my code and provide feedback. "your original solution handles lines like this properly: I made reference to the fact that we're dealing with "very specific input" in "Re^4: Suggestions to make this code more Perlish". I also alluded to the fact that different code would be required if the input changed. You're correct in saying that it "will never dequote the last field"; however, the last field (in this "very specific input") is an unquoted integer, so no dequoting is required. "One other minor observation: \037 is an atom, ..." Yes, that's how I used \037 (along with \036 and \012) in:
"... so no brackets are needed in s/[\037]+$//;" The use of brackets here was a conscious decision to make it more obvious what the '+' quantifier referred to. You're correct in saying that 's/\037+$//' would have worked as well as 's/[\037]+$//'. -- Ken
In Section
Seekers of Perl Wisdom
|
|