summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
diff options
context:
space:
mode:
authorTels <nospam-abuse@bloodgate.com>2001-12-01 11:29:11 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-01 15:52:13 +0000
commitba964c95d0edb0b5a4c30a52b8a82fe58a4ff0cc (patch)
treee9e62c866e12b3d66c3062bb7a6b8ef68f65781f /pod/perlfunc.pod
parent50fb311132b0e2e94d55d38160ba1815c5c89f0d (diff)
downloadperl-ba964c95d0edb0b5a4c30a52b8a82fe58a4ff0cc.tar.gz
Re: [PATCH] [ID 20011130.166] "in memory" file handles via scalas not documented in perldoc -f open
Message-Id: <200112010931.LAA29309@tiku.hut.fi> p4raw-id: //depot/perl@13402
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r--pod/perlfunc.pod11
1 files changed, 11 insertions, 0 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 0271862538..2b20a4b63c 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -2666,6 +2666,8 @@ conversion assumes base 10.)
=item open FILEHANDLE,MODE,EXPR,LIST
+=item open FILEHANDLE,MODE,REFERENCE
+
=item open FILEHANDLE
Opens the file whose filename is given by EXPR, and associates it with
@@ -2778,6 +2780,10 @@ argument being C<undef>:
opens a filehandle to an anonymous temporary file.
+File handles can be opened to "in memory" files held in Perl scalars via:
+
+ open($fh,'>', \$variable) || ..
+
Examples:
$ARTICLE = 100;
@@ -2802,6 +2808,11 @@ Examples:
open(EXTRACT, "|sort >/tmp/Tmp$$") # $$ is our process id
or die "Can't start sort: $!";
+ # in memory files
+ open(MEMORY,'>', \$var)
+ or die "Can't open memory file: $!";
+ print MEMORY "foo!\n"; # output will end up in $var
+
# process argument list of files along with any includes
foreach $file (@ARGV) {