推 herculus6502: | 01/30 07:01
願聞其詳 例如像這樣嗎? perl |變數1 |變數2
※ 編輯: gecer (111.255.20.25), 01/30/2016 10:42:30
→ abliou: 只有"兩行"的問題,大概不會有大於兩行的答案 01/30 15:31
假設我有個perl code
my $o=<STDIN>;
print "$o\n";
my $c=<STDIN>;
print "$c\n";
想用batch file 去執行 但是我不想等從鍵盤輸入stdin 所以想寫batch file 去執行上面
的perl code
perl test.pl <first stdin> <second stdin>
perl test.pl <first stdin> <second stdin>
perl test.pl <first stdin> <second stdin>
perl test.pl <first stdin> <second stdin>
不知道batch file 語法要怎麼寫
※ 編輯: gecer (111.255.20.25), 01/30/2016 17:27:04
推 LiloHuang: 可以考慮把 <STDIN> 改成 $ARGV[0], $ARGV[1] 以此類推 01/30 19:55
推 flu: 原po你要的資料來源是叫作命令列引數,不叫stdin喔 01/30 21:43
推 flu: perl的神奇運算子<>有跨界處理命令列引數(為名的檔案)和stdin 01/30 21:46
→ flu: 雖然方便但要小心混淆 01/30 21:47