【发布时间】:2015-08-01 02:59:08
【问题描述】:
我正在尝试找到在两个文件之间执行模式匹配和处理的所有不同方法。我是 perl 新手,需要一些帮助。
我有两个文件。 Colors.txt 看起来像这样:
Joe likes the color green.
Sam likes the color blue.
Pencils.txt 看起来像这样:
Pencil one is blue.
Pencil two is green.
我需要解析这两个文件,并打印以下内容:
Sam's pencil is number one because he likes the color blue.
Joe's pencil is number two because he likes the color green.
有人可以指导我如何有效地处理这个问题吗?
【问题讨论】: