Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by kennethk (Abbot)
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
Replies are listed 'Best First'.
Re^4: Temporary file management in Perl -- is it possible?
by taint (Chaplain) 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 meditating upon the Monastery: (9)
As of 2015-07-08 03:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls