cvs commit: perlfaq perlfaq5.pod
[email protected] (brian d foy) 3 Jan 2005 18:27:40 -0000
| Newsgroups | perl.cvs.perlfaq |
|---|---|
| Message-ID | <[email protected]> |
cvsuser 05/01/03 10:27:40
Modified: . perlfaq5.pod
Log:
* How do I make a temporary file name?
+ added example using undef as a filename for open()
Revision Changes Path
1.33 +8 -2 perlfaq/perlfaq5.pod
Index: perlfaq5.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq5.pod,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- perlfaq5.pod 14 Dec 2004 16:36:20 -0000 1.32
+++ perlfaq5.pod 3 Jan 2005 18:27:40 -0000 1.33
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq5 - Files and Formats ($Revision: 1.32 $, $Date: 2004/12/14 16:36:20 $)
+perlfaq5 - Files and Formats ($Revision: 1.33 $, $Date: 2005/01/03 18:27:40 $)
=head1 DESCRIPTION
@@ -108,7 +108,13 @@
=head2 How do I make a temporary file name?
-Use the File::Temp module, see L<File::Temp> for more information.
+If you don't need to know the name of the file, you can use C<open()>
+with C<undef> in place of the file name. The C<open()> function
+creates an anonymous temporary file.
+
+ open my $tmp, '+>', undef or die $!;
+
+Otherwise, you can use the File::Temp module.
use File::Temp qw/ tempfile tempdir /;