in reply to Re^2: convert date format from YYYY-MM-DD to YYYYMMDD
in thread convert date format from YYYY-MM-DD to YYYYMMDD
That is a perfectly good approach if you’re certain the data will always match expectations. This is a poor assumption if you don’t know it for a fact though.
The tr///d option is faster than s///g but it would only be something to really care about for huge datasets where the very small difference would add up.
Lastly, I want to X without using any perl modules sounds like a good conclusion in this case but it’s one that you shouldn’t make in the general case unless this is pure hobby work you don’t care much about. Learning to use modules—there are good date ones in the core and plenty more available on the CPAN—and understanding the greater Perl ecosphere is what will make your future tasks easier, even trivial, and future employment and salary growth much more likely.
|
|---|