Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
more useful options
 
PerlMonks  

Re^3: Temporary file management in Perl -- is it possible?

by kennethk (Monsignor)
on Apr 25, 2013 at 14:48 UTC ( #1030685=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Temporary file management in Perl -- is it possible?
in thread Temporary file management in Perl -- is it possible?

If you want to do a clean-up first, you could invoke system at the start of your script:

system(q{find . -type f -name '*.tbz2' -maxdepth 1 -cmin '+24' | xargs + rm})
You can also invoke all necessary commands in Perl
opendir my $dh, '.'; for (readdir $dh) { unlink if -l and /\.tbz2$/ and 24 * 60 * -M > 10; }
See -X.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re^3: Temporary file management in Perl -- is it possible?
Select or Download Code
Re^4: Temporary file management in Perl -- is it possible?
by taint (Hermit) on Apr 25, 2013 at 17:29 UTC
    Greetings kennethk, and thank you for taking the time to provide this solution!
    That's exactly what I was thinking. But, while having read -X, still hadn't figured out how to accomplish it in Perl.
    Thanks, again. I really appreciate it.

    --chris

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (16)
As of 2014-04-17 14:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (449 votes), past polls