I can't fix this error...
我无法修正这个错误……
@temp=split(/(/)/,$headerLine);
this error appears
这个错误出现
Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE
2 个解决方案
#1
7
Use
使用
@temp=split(/(\/)/,$headerLine);
or
或
@temp=split(m&(/)&,$headerLine);
The slash in the parentheses prematurely terminates your regular expression.
括号中的斜线过早地终止正则表达式。
#2
5
Your second /
character is terminating the regular expression, so Perl is interpreting your code as:
您的第二个/字符将终止正则表达式,因此Perl将您的代码解释为:
@temp=split /(/
followed by garbage.
其次是垃圾。
Simply escape the literal /
:
简单地逃避字面/:
@temp=split(/(\/)/, $headerLine)
#1
7
Use
使用
@temp=split(/(\/)/,$headerLine);
or
或
@temp=split(m&(/)&,$headerLine);
The slash in the parentheses prematurely terminates your regular expression.
括号中的斜线过早地终止正则表达式。
#2
5
Your second /
character is terminating the regular expression, so Perl is interpreting your code as:
您的第二个/字符将终止正则表达式,因此Perl将您的代码解释为:
@temp=split /(/
followed by garbage.
其次是垃圾。
Simply escape the literal /
:
简单地逃避字面/:
@temp=split(/(\/)/, $headerLine)