in reply to Can't clone STD handle with :via layer
Hi there. I have two suggestions:
(1) Why are you trying to open a filehandle to STDOUT? Why not just print?
For example, this:
#!/usr/bin/env perl use strict; use warnings; use PerlIO::via::QuotedPrint; binmode STDOUT, ':via(QuotedPrint)'; print " ";
Prints this:
=20=(2) If you actually need to use STDOUT as a filehandle, an alternative that gives the same output as above is this:
binmode STDOUT, ':via(QuotedPrint)'; my $fh = \*STDOUT; print $fh " ";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can't clone STD handle with :via layer
by zdm (Beadle) on Apr 08, 2014 at 14:56 UTC | |
by tobyink (Canon) on Apr 08, 2014 at 15:07 UTC | |
by zdm (Beadle) on Apr 08, 2014 at 16:00 UTC |