Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: Perl script on windows node

by kaka_2 (Sexton)
on Apr 03, 2012 at 12:14 UTC ( [id://963229]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl script on windows node
in thread Perl script on windows node

Thanks Stevieb. I made the changes and compilation and execution was successfull but result is not satisfactory. It always says "File is not recent" where i see file was always got modified in last 120 seconds. Any thoughts?

Replies are listed 'Best First'.
Re^5: Perl script on windows node
by marto (Cardinal) on Apr 03, 2012 at 12:25 UTC

    If you copy and paste this code as is and expect it to do what you want, it's not going to work. The variable $file needs to contain the path to a file for example:

    my $file = "C:\\stat.pl";

    With the value provided as an example the script will always pass through to the "File is not recent" message. You should alter the code to check for existing files. I'll leave that as an exercise for you.

Re^5: Perl script on windows node
by Happy-the-monk (Canon) on Apr 03, 2012 at 12:24 UTC

    my $modified_within = 60 * 5; # 5 minutes

    Did you copy this line to the letter & number? - maybe you should adjust it to your needs.

    Cheers, Sören

Re^5: Perl script on windows node
by stevieb (Canon) on Apr 03, 2012 at 12:26 UTC

    Well, if you're sure your looking at the right file, and that $modified_within is set to 60*2 or less, it may be a quirk on Windows. The code works here for me on my Ubuntu and FreeBSD machines.

    I don't run Perl on Windows, so hopefully someone else here can give the code a test, or perhaps spot something they may know doesn't work properly on the Win platform.

Log In?
Username:
Password:

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

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

    No recent polls found