|
Perl. как вызвать файл?
|
|||
---|---|---|---|
#18+
Помогите пожалуйста с таким вот вопросом -) Я написала скрипт, который в линукс терминале должен вызываться так: cat input.txt | perl my_script.pl exclusion_list.txt > output.txt Скрипт должен менять input.txt кроме случаев описанных в exclusion_list.txt и выводить в результат в output.txt. Я написала основную часть программы в while (<>) loop-e, чтобы работала часть cat input.txt | perl my_script.pl С > output.txt также просто. Но никак не могу получить доступ к exclusion_list.txt. my $filename = <STDIN>; open(my $fh, '<', $filename) or die "Could not open file '$filename' $!"; дает: Name "main::SDIN" used only once: possible typo at cid line 59. readline() on unopened filehandle SDIN at cid line 59. Use of uninitialized value $filename in open at cid line 60. Use of uninitialized value $filename in concatenation (.) or string at cid line 60. Could not open file '' No such file or directory at cid line 60. ... |
|||
:
Нравится:
Не нравится:
|
|||
24.02.2018, 01:03 |
|
|
start [/forum/topic.php?fid=23&msg=39606656&tid=1460372]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
40ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
30ms |
get tp. blocked users: |
1ms |
others: | 319ms |
total: | 434ms |
0 / 0 |