Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^4: Perl script on windows node

by kaka_2 (Sexton)
on Apr 03, 2012 at 12:14 UTC ( #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 (Archbishop) 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:\\";

    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 (Abbot) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://963229]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2018-05-20 18:18 GMT
Find Nodes?
    Voting Booth?