- or download this
my $rxParsePath = qr
{(?x) # Use extended regular expression syntax to
...
# be a file name part
$ # Anchor pattern to end of string
};
- or download this
use strict;
use warnings;
...
map { sprintf qq{%20s%15s%15s%10s%10s\n}, @$_ }
map { [ $_, map { defined $_ ? $_ : q{} } m{$rxParsePath} ] }
qw { /etc/motd /var/adm/messages.1 .alias a.html ab.cd.txt /bin };
- or download this
Path Directory File Name File Stub Extension
/etc/motd /etc/ motd motd
...
a.html a.html a .html
ab.cd.txt ab.cd.txt ab.cd .txt
/bin / bin bin