http://www.perlmonks.org?node_id=1030903

taint has asked for the wisdom of the Perl Monks concerning the following question:

Greetings everyone,
I've been struggling with an attempt to clobber symlinks in a folder, if they are older than N minutes.
After much work with File::Find, I found that I am unable to make it work. SO, I decided to look to perlfunc's -X (-C in this case). which will return the Creation-time, which I can compare to Current-time. Allowing me to clobber anything older than 11 minutes from now.
Problem is, I'm not smart enough to figure out to how list the files Creation-time with perlfunc's -C. Looking at How do I delete... get's me close. But does mtime (modified) == ctime?
I could get close:
# delete $file if it's not been modified for 15 minutes if ( (stat $file)[9] < time() - (3600 / 5) ) { unlink $file; }
Never mind the example above, it doesn't work, it returns:
Use of uninitialized value in numeric lt (<) at line 12 (#1) (W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a "" or a 0, but maybe it was a mistak +e. To suppress this warning assign a defined value to your variables.
Would anyone be willing to provide an example, please?

Thank you for all your consideration

--chris

#!/usr/bin/perl -Tw
use perl::always;
my $perl_version = "5.12.4";
print $perl_version;