Do you know where your variables are? | |
PerlMonks |
Re^3: making a text file to an hash arrayby johngg (Canon) |
on Jul 15, 2010 at 20:36 UTC ( [id://849862]=note: print w/replies, xml ) | Need Help?? |
You can use the same code because the \s* and \s+ in the match will also cater for newline (and carriage return if on Windows) so extracting the key and value parts will still work.
If your data is in a file then slurp the whole of the file into a scalar. Something like (using strictures and warnings):-
I hope this answers your question. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|