That is what I'd perhaps use too, depending on the application. If I'd chose this way I'd even tag along a success check (and add anchors). Your format may change some day and then you'll be glad you caught that.
my ($y, $m, $d) = $today =~ /^(\d\d\d\d)(\d\d)(\d\d)\z/ or die "Incorrect date format: '$today'";
ihb
See perltoc if you don't know which perldoc to read!
In reply to Re^2: splitting a string into arbitrary lengths
by ihb
in thread splitting a string into arbitrary lengths
by ryanc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |