我對perl不是很熟悉,但是我想知道這是否可以做到?如何查找由獨特字符分隔的變量?
所以我有一個看起來像文件:
Stringa = Stringx Stringz
Stringb = Stringy
Stringc = Stringw Stringx Stringu
凡在左邊我有一個字。在右邊我有多個詞。我想創建一個哈希表,其中關鍵字是左邊的單詞(即stringa),值是包含右側元素(即stringx stringz)的數組。在右側,元素只能被空格分隔,我需要包含 - * $ @,所有這些垃圾。
謝謝。
如果我真的想要一條線來表示一個鍵值* pair *,我會做'split/\ s * = \ s * /,$ line,2'。 – Axeman 2011-03-30 22:55:11