in reply to extracting year of a file

You can use stat to get the last modification time (that's what ls reports) and then localtime to find out what year that was.

my $filename = 'your_file_name_here'; my $mtime = (stat $filename)[9]; my $year = (localtime $mtime)[5] + 1900;