5
Eski kodumu aşağıdaki gibi yeni stilde yeniden yazarım:OO stili ile boruları nasıl açabilirim?
#old style
open(FD,"file");
#new style
$fh = IO::File->new("file","r");
Dosyalar iyi, fakat boruları nasıl açacağımı bilmiyorum.
# read from pipes.
open(PIPE,"some_program |");
# write to pipes.
open(PIPE,"| some_program");
OO Stil IO'da borular nasıl kullanılır?
ekleme:
teşekkürler Jonathan, sorun değil.
# 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";