2012年1月31日星期二

Perl Open File and Pipe

open(FH, "<", "input.txt")
1.FH="input.txt"
2.FH is <, which means FH is (file) source whose content provides input(similar as stdin) to current program
3.if >, which means FH is a file accepting the output of current program

open(FH, "-|", "input.sh") 
1.FH="input.txt"
2.FH is <, which means is a (command) source whose output provides input(similar to stdin) to current program
3.if |-, >, which means FH is a command whose stdin accepts the output of current program


 

没有评论: