I'm looking for an efficient way to sort the following in perl:
/this/is/the/file/path/June/n06302004_2004063009.html
/this/is/the/file/path/July/n07012004_2004070108.html
/this/is/the/file/path/July/n07012004_2004070103.html
/this/is/the/file/path/July/n07012004_2004070109.html
I need to sort the above in descending order by the filename, not the entire path (n06302004_2004063009.html, etc.) so that it looks like:
/this/is/the/file/path/July/n07012004_2004070109.html
/this/is/the/file/path/July/n07012004_2004070108.html
/this/is/the/file/path/July/n07012004_2004070103.html
/this/is/the/file/path/June/n06302004_2004063009.html
Is there a way to pick out the filenames out of the path, sort by the filename, while preserving the entire filepath? Perhaps by a perl custom sort?
Any help would be appreciated. Thanks.
/this/is/the/file/path/June/n06302004_2004063009.html
/this/is/the/file/path/July/n07012004_2004070108.html
/this/is/the/file/path/July/n07012004_2004070103.html
/this/is/the/file/path/July/n07012004_2004070109.html
I need to sort the above in descending order by the filename, not the entire path (n06302004_2004063009.html, etc.) so that it looks like:
/this/is/the/file/path/July/n07012004_2004070109.html
/this/is/the/file/path/July/n07012004_2004070108.html
/this/is/the/file/path/July/n07012004_2004070103.html
/this/is/the/file/path/June/n06302004_2004063009.html
Is there a way to pick out the filenames out of the path, sort by the filename, while preserving the entire filepath? Perhaps by a perl custom sort?
Any help would be appreciated. Thanks.