sort them based on creation time.
...
map { [ stat("$sp_dir/$_")->ctime, $_] }
ctime is NOT the creation time of a file. On Unix and Linix file systems the creation time of the file is NOT stored anywhere.
As the stat function says:
10 ctime inode change time in seconds since the epoch (*)
(*) Not all fields are supported on all filesystem types. Notably, the ctime field is non-portable. In particular, you cannot expect it to be a "creation time", see "Files and Filesystems" in perlport for details.