Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
This is an excellent question, and I don't know the answer. The behaviour you describe is surprising, at least to me. The development version of perl exhibits the same behaviour. I wonder whether this is a known limitation, because there is a warning in perlfunc:
Though if you try to re-open C<STDOUT> or C<STDERR> as an "in memory" file, you have to close it first: close STDOUT; open STDOUT, '>', \$variable or die "Can't open STDOUT: $!";
Of course this isn't talking about encodings, but I think it might be the same problem. Unless a PerlIO guru pops up here, I'd suggest asking p5p.

PS. If you just want a minimal demonstration script, you can delete most of your code:

# close STDOUT; # with this it works open STDOUT, ">:encoding(cp37)", "foo.out" or die "Cannot redirect STD +OUT\n"; print "yadda yadda\n";

In reply to Re: Redirection and encoding, broken or WAD? by robin
in thread Redirection and encoding, broken or WAD? by BillSeurer

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2022-10-04 16:26 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (18 votes). Check out past polls.