perl open |
时间:2009-07-29 来源:huanghaojie
If the filename begins with '|' , the filename is interpreted as a command to which output is to be piped, and if the filename ends with a '|' , the filename is interpreted as a command which pipes output to us.
将打开文件的流重定向到后面的shell语句
#!/usr/bin/perl
open F , "|cat" or die "error to open";
print F "aaaa\n";
close F;
将shell语句的内容重定向到流
#!/usr/bin/perl
open FF , "ls |" or die "error to open";
print <FF> ;
close FF;
将打开文件的流重定向到后面的shell语句
#!/usr/bin/perl
open F , "|cat" or die "error to open";
print F "aaaa\n";
close F;
将shell语句的内容重定向到流
#!/usr/bin/perl
open FF , "ls |" or die "error to open";
print <FF> ;
close FF;
相关阅读 更多 +