Thread Datei in einen Hash einlesen
(20 answers)
Opened by crojay at 2011-04-14 01:34 2011-04-20T06:58:13 crojay Whitespace ums '=' mit in die RegEx nehmen: Code (perl): (dl
)
%exportHash = map { chomp; split /\s*=\s*/, $_, 2; } <HASHFILE>; Gruß FIFO [Edit] Erklärung: Dein Muster macht aus "page1 = 12" Folgendes: $exportHash{'page1 '} = ' 12' Last edited: 2011-04-20 11:10:54 +0200 (CEST) Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"
|