summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-02-22 13:01:49 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-02-22 17:46:51 -0800
commit445b09e5977082e9918069b18050f72d1f90ab44 (patch)
tree43e908c4f64ac71496e9b93f0ae842cac286be46
parenta7c1632ddd60f69c0d947987c4c8a59f2cd23e63 (diff)
downloadperl-445b09e5977082e9918069b18050f72d1f90ab44.tar.gz
perlfunc/formline: Suggest an alternate capturing method
(When I was starting to program in Perl, I wasted a lot of time trying to use formline as an alternate version of write, in order to capture the output. Eventually I created a pipe() and used that. But now we have scalar ‘filehandles’, it’s much easier.)
-rw-r--r--pod/perlfunc.pod4
1 files changed, 4 insertions, 0 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 891d938300..67c7255c54 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -2101,6 +2101,10 @@ Be careful if you put double quotes around the picture, because an C<@>
character may be taken to mean the beginning of an array name.
C<formline> always returns true. See L<perlform> for other examples.
+If you are trying to use this instead of C<write> to capture the output,
+you may find it easier to open a filehandle to a scalar
+(C<< open $fh, ">", \$output >>) and write to that instead.
+
=item getc FILEHANDLE
X<getc> X<getchar> X<character> X<file, read>