Front page | perl.perl5.porters |
Postings from April 2011
PATCH: perlop booboo
Thread Next
From:
Tom Christiansen
Date:
April 22, 2011 19:36
Subject:
PATCH: perlop booboo
Message ID:
23812.1303526160@chthon
% diff -u blead/pod/perlop.pod /tmp
--- blead/pod/perlop.pod 2011-04-19 15:13:11.000000000 -0600
+++ /tmp/perlop.pod 2011-04-22 20:34:27.000000000 -0600
@@ -1786,11 +1786,11 @@
The STDIN filehandle used by the command is inherited from Perl's STDIN.
For example:
- open BLAM, "blam" || die "Can't open: $!";
- open STDIN, "<&BLAM";
- print `sort`;
+ open(SPLAT, "stuff") || die "can't open stuff: $!";
+ open(STDIN, "<&SPLAT") || die "can't dupe SPLAT: $!";
+ print STDOUT `sort`;
-will print the sorted contents of the file "blam".
+will print the sorted contents of the file named F<"stuff">.
Using single-quote as a delimiter protects the command from Perl's
double-quote interpolation, passing it on to the shell instead:
Thread Next
-
PATCH: perlop booboo
by Tom Christiansen