#!/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;
}在这段代码中,我收到一个错误:
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?)发布于 2014-04-02 17:45:47
替换
perl -ne '($host, $port, @ip) = split /[=;.]/; print if $port != 50000+200*$i[2]+$ip[3]' eg;至
my ($host, $port, @ip) = split /[=;.]/;
print if $port != 50000+200*$ip[2]+$ip[3];再试一次。
https://stackoverflow.com/questions/22806250
复制相似问题