Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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: $
    close FH;
  2. or download this
    use IO::File;
    my $fh = IO::File->new("/tmp/myprocess.tmp", "w");
  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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://128876]
Approved by root
Discipulus open a red wine bottle and ..
Discipulus adds tozzetti alle mandorle to the platter on the sideboard.
[Discipulus]: the most monastic cookie!
[choroba]: Discipulus BTW, I loved Settembrini by Mulino Bianco years ago in Italy
[choroba]: then they stopped producing them...
[choroba]: But it seems they make them again?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-04-27 10:37 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (503 votes). Check out past polls.