Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Getting modification time in perl not working on my MAC

by Anonymous Monk
on Mar 21, 2014 at 22:38 UTC ( [id://1079363]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Getting modification time in perl not working on my MAC
in thread Getting modification time in perl not working on my MAC

Though, with all the variables correct, it is still not working. -M command is working if it is between the opendir and closedir lines

Well you have  -M $moviedir[1] and  -M "$CosMovFolder/$moviedir[1]" its the basic stumbling block of readdir that everyone stumbles on .

readdir is just low level api ... low level api are a pain

use Path::Tiny its easy

use Path::Tiny qw/ path /; my @sorted_files = map { $$_[1] } sort { $$a[0] <=> $$b[0] } map { [ $_->stat->mtime, $_ ] } path( $CosMovFolder )->realpath->children();

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1079363]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-03-19 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found