<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tagomoris</author_name>
  <author_url>https://blog.hatena.ne.jp/tagomoris/</author_url>
  <blog_title>たごもりすメモ</blog_title>
  <blog_url>https://tagomoris.hatenablog.com/</blog_url>
  <categories>
    <anon>perl</anon>
  </categories>
  <description>いま書いてるコードで、forkしてexecするんだけど、execする前にSTDIN/STDOUTを任意のファイルハンドルに置き換えたいなー、もっというとexecするプログラムのSTDINにソケットのREADから流れてくるデータを流し込んで、STDOUTの出力をソケットのWRITEに流し込んでやりたいなー、というようなことを考えていた。で、これが例えば今のプロセスのSTDOUTの出力をファイルに置き換えるには、以下のようにすればいい。 open(STDOUT, '&gt;', '/path/to/file'); シェルスクリプトでも簡単。*1 exec &gt;&gt; /path/to/file さて、STDI…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftagomoris.hatenablog.com%2Fentry%2F20120918%2F1347940083&quot; title=&quot;PerlでSTDIN/STDOUTを任意のファイルハンドルに置き換える - たごもりすメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>http://a0.twimg.com/profile_images/1824733408/profile2012_normal.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-09-18 12:48:03</published>
  <title>PerlでSTDIN/STDOUTを任意のファイルハンドルに置き換える</title>
  <type>rich</type>
  <url>https://tagomoris.hatenablog.com/entry/20120918/1347940083</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
