質問

私は書き換え自分のコードを新しいスタイルは、以下のように:

#old style
open(FD,"file");

#new style
$fh = IO::File->new("file","r");

ファイル、もしっかり身につけるたノウハウで開きますことができた。

# read from pipes.
open(PIPE,"some_program |");

# write to pipes.
open(PIPE,"| some_program");

取り扱いについて定められたパイプスタイルOO IO?

追加:
コジョナサンです。

# read from pipes.
$pipe = IO::Pipe->new;
$pipe->reader('some_program');
$data = <$pipe>;

# write from pipes.
$pipe = IO::Pipe->new;
$pipe->writer('some_program');
print $pipe "foo,bar,baz";
役に立ちましたか?

解決

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top