【发布时间】:2011-04-27 19:27:41
【问题描述】:
我在解析包含数千行的复杂文件时遇到问题。
几天前我已经实现了我的 Perl 脚本。
my ($head, $tail) = split /=/, $line;
我几乎所有的源文件$line 样式如下:
constant normalLines = <type value> /* hello world */
我可以得到输出$tail = /* hello world */
今天我这样解析行时发现了一个bug(行中有两个=)
constant specialLine = <type value> /* hello = world */
但现在输出是$tail = /* hello
如何修复我在上面的代码中仍然使用split() 的错误?我仍然想要输出$tail = /* hello = world */
【问题讨论】: