看板 Perl 關於我們 聯絡資訊
如題 我有一個perl 執行時會等待輸入stdin 但是我有大量的資料要經過這個perl處理 請問如何從batch file 寫入 stdin? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.255.20.25 ※ 文章網址: https://www.ptt.cc/bbs/Perl/M.1454080573.A.6F0.html
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