in reply to Using Temporary Files in Perl
open( $fh, '+>', undef ) || die $!;
Where the undefined value is a literal undef statement, rather than an undefined variable. It should also be noted that the File::Temp module has now too been incorporated into the core distribution.
Another feature which allows for temporary file-type handling within code is that which allows for file handles to be opened into a memory space, via a scalar reference - For example:
open( $fh, '>', \$variable ) || die $!;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using Temporary Files in Perl
by jjosserand (Initiate) on Mar 30, 2015 at 15:29 UTC | |
by choroba (Cardinal) on Mar 30, 2015 at 16:20 UTC |