Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Using Temporary Files in Perl

by rob_au (Abbot)
on Dec 01, 2001 at 20:18 UTC ( #128876=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    local *FH;
    open (FH, ">/tmp/myprocess.tmp") || die "Cannot open temporary file: $
    +!\n";
    ...
    ...
    
    close FH;
    
  2. or download this
    use IO::File;
    my $fh = IO::File->new("/tmp/myprocess.tmp", "w");
    ...
    
        $fh->close;
    }
    
  3. or download this
    use Fcntl;
    use POSIX;
    ...
    do {
        $name = tmpnam();
    } until sysopen(FH, $name, O_RDWR|O_CREAT|O_EXCL, 0666);
    
  4. or download this
    use IO::File;
    my $fh = IO::File->new_tmpfile;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://128876]
Approved by root
help
Chatterbox?
[thezip]: Where did you go? We've already set a record for all-time February rainfall here.
[Corion]: thezip: The Canary Islands - they have a constant climate
[Corion]: Maybe a bit too many old people, but for some do-nothing vacation for R&R exactly the right thing ;)=
[thezip]: That's awesome. I bet you feel totally rejuvenated and ready for the next thing.

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-02-23 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (349 votes). Check out past polls.