[英]Perl : Bareword found where operator expected
#!/usr/bin/perl
use strict;
use warnings;
open(my $fh, '<', 'eg')
or die("Can't open fileC: $!\n");
while (<$fh>) {
perl -ne '($host, $port, @ip) = split /[=;.]/; print if $port != 50000+200*$i[2]+$ip[3]' eg;
}
In this code I am receiving an error : 在这段代码中,我收到一个错误:
Bareword found where operator expected at qeg.pl line 15, near "'($host, $port, @ip) = split /[=;.]/; print if $port != 50000+200*$i[2]+$ip[3]' eg"
(Missing operator before eg?)
Replace 更换
perl -ne '($host, $port, @ip) = split /[=;.]/; print if $port != 50000+200*$i[2]+$ip[3]' eg;
to 至
my ($host, $port, @ip) = split /[=;.]/;
print if $port != 50000+200*$ip[2]+$ip[3];
and try again. 然后再试一次。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.