in reply to Getting modification time in perl not working on my MAC
-M $dir[1]; # tried this, not working.
Non-existent variables don't exist ... makes sense to me
Whatever problem you're trying to solve, use strict 'vars'; will warn you about inventing variable names you havent used yet
Anyway, readdir is the devil, use Path::Tiny, it throws "exceptions" like autodie
use Path::Tiny qw/ path /; my @files = path( $CosMovFolder )->realpath->children(); my @sorted_files = map { $$_[1] } sort { $$a[0] <=> $$b[0] } map { [ -m $_, $_ ] } @files;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting modification time in perl not working on my MAC
by hary536 (Novice) on Mar 21, 2014 at 16:36 UTC | |
by hary536 (Novice) on Mar 21, 2014 at 17:03 UTC | |
by hazylife (Monk) on Mar 21, 2014 at 17:16 UTC | |
by Anonymous Monk on Mar 21, 2014 at 22:38 UTC |