Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Finding Last minute file in a directory

by John007 (Acolyte)
on Aug 16, 2009 at 16:52 UTC ( [id://789033]=note: print w/replies, xml ) Need Help??


in reply to Re: Finding Last minute file in a directory
in thread Finding Last minute file in a directory

Dear zwon,
I ran your code, I only have perl 5.8 version so it errored out for that and it also gave me other problems.
#!/usr/bin/perl use Data::Dumper; use Time::localtime; use File::stat; use Term::ANSIColor; use Net::FTP; use warnings; use File::Spec; my $dirname = '.'; opendir( my $dir, $dirname ) or die $!; my $file; while ( $file = readdir($dir) ) { last if ( stat( File::Spec->catfile( $dirname, $file ) ) )[9] + 60 + > time; $file = ''; }

Replies are listed 'Best First'.
Re^3: Finding Last minute file in a directory
by zwon (Abbot) on Aug 16, 2009 at 17:59 UTC

    The only 5.10 feature I've used is say and you can replace it by print. I recommend you to use strict as it helps to prevent some errors. Do you have any other problems with my example?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-25 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found