If you want the file extension to be treated as an independent secondary sorting key, you can use Sort::Key::Maker for creating a multi-key sorting function:
use Sort::Key::Natural; use Sort::Key::Maker sort_filenames => sub { /^(.*?)((?:\.[^\.]*)?)$/ +}, qw(natural natural); my @filenames = qw(...); my @sorted = sort_filenames @filenames;
In reply to Re: Natural Sort / Windows sort problem
by salva
in thread Natural Sort / Windows sort problem
by cr8josh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |