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

Re: Perl script on windows node

by tobyink (Canon)
on Apr 03, 2012 at 08:22 UTC ( #963191=note: print w/replies, xml ) Need Help??

in reply to Perl script on windows node

Read the perlfunc sections about "-X", "stat" and "time".

use 5.010; use strict; my $modified_within = 60 * 5; # 5 minutes my $size_limit = 1024 * 1024 * 2; # 2 MB my $file = "/some/file/name"; if ([stat $file]->[9] > time - $modified_within) { if (-s $file > $size_limit) { say "File is recent, and over size limit"; } else { say "File is recent, but not over size limit"; } } else { say "File is not recent"; }
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2022-01-22 15:53 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (63 votes). Check out past polls.