Well it's one thing to try this as an exercise, for most things significant effort has been spent on the non-trivial task of catering for everything when parsing, same goes for HTML, XML etc...
| [reply] |
"As a learning" exercise is about the only valid reason to eschew CPAN I can think of. As a learning exercise it is especially useful if it serves to contrast the benefit of using CPAN compared to rolling your own solution. It is even more useful if the learning exercise also involves creating even a tiny fraction of the testing that CPAN modules are subject to.
If that is the objective of your manager and you have been given time to engage in this learning exercise then you have a truly enlightened manager!
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
| [reply] |
I have a working script using CPAN, yet my manager said its way too easy and I should try achive the same thing by using only regex
That's plain stupid and a waste of time. If your manager regularly behaves like this, search for another job. It's just not worth wasting your time this way. Been there, done than.
Imagine a carpenter's manager telling him to put way all tools except for a rock with a sharp edge. Sure, you could build a house with that rock. But using modern tools is less risky and way faster.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] |
I was thinking about making a similar comment waffling between being slightly more tactful or much less so WRT said manager. JSON is a standard, there's off the shelf parsers for it that have been extensively tested. If you stick to "just" regexen you're reimplementing a perfectly good wheel for no benefit at the cost of less testing, a custom implementation that may not handle everything valid by the spec, may need tricky extra stuff like embedded code in the regex to get corner cases, . . .
As a learning exercise, sure maybe. Production code? Inane is probably being kind.
The cake is a lie.
The cake is a lie.
The cake is a lie.
| [reply] |
NIH is a cancer. Unless you picked one of the few clinkers from the CPAN, and I don’t think there are any JSON modules that fit that particular bill. What afoken and Fletch said**10.
| [reply] [d/l] |