【发布时间】:2020-09-10 23:08:57
【问题描述】:
我正在寻找以下情况的解决方案。
我需要从我的 Perl 脚本 disconnect.pl 中读取 task.txt 文件, 我必须将文件的内容保存到可以在 Perl 脚本中的多个位置使用的变量中。
Task.txt 文件包含用逗号分隔的单引号中的单词,但在一行中,如下所示
'qbc','456','sdf','fgh'
#########################
my $filename = 'testing_folder/text_document.txt';
open(FH, '<', $filename) or die $!;
while(<FH>){
$content=$_
}
print "$content"
my $ql = "select in ($content)";
print "$ql"
###############################
my $ql 行出现错误
【问题讨论】:
-
只需谷歌“perl 文件教程”,然后是“perl 拆分教程”。
-
试过了.. 出现错误
标签: perl