This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package DateRange; | |
# Usage: `use DateRange qw( getDateArray );` | |
use strict; | |
use warnings; | |
use base qw(Exporter); | |
our $VERSION = 1.00; | |
our @EXPORT_OK = qw( &getDateArray ); | |
sub getDateArray { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Spelling corrected: Schwartzian transform | |
2. No need to use parens around \d{8}. | |
3. I like ST better, but GRT is faster for large lists: | |
http://www.perlmonks.org/?node_id=145659 | |
4. Need to warn or die to show bad data when regex fails. | |
5. Perl 6 automatically does ST for you: | |
my @sorted = @files.sort({ / SWITCH _ \d**8 _ (\d**6) / or die; $0; }); |