The logic in your logging is incorrect.
File::Copy's 'copy' function returns 0 on failure, not success. Have a look at the contents of $! - that should hold any error message.
How do $filename and $szNewBBSfile get set?
All variables are package variables by default, unless stated otherwise. You'll have to declare them.
You should know that 'local' in Perl means something different to what people often expect. You're more than likely looking for a lexical variable, which are declared using "my".
Yes, either change the structure of @parts as it's being created, or else restructure it so it can be sorted easier. Here's an example (I've just used strings instead of the arrayrefs to illustrate):
my @parts = (1,2602344000,'Ball Valve',1.0000,'array(memaddress)',2,2602345000,'Gate...
Also, try printing the outcome of using -M to see what values you are getting back. That'll give you a better indication of what comparisons you need to make.
I'd never rely on print statements to see if a file exists. Use -f or -e instead. I would expect that the files will only exist if $DirPath is the current working directory.
Firstly, make sure the file exists.
Second, if you want it to be older than 60 minutes, you need -M to return a number greater than 0.0416, not less than it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.