in reply to Parsing semi-erratic text
The data you submitted *does* have newlines.
while (<DATA>) { my ($key, $val) = /^\s*([^:]*?)\s*:\s*(.*?)\s*$/ or next; print("[$key:$val]\n"); }
and
while (<DATA>) { my ($key, $val) = split(/:/, $_, 2); next if not defined $val; s/^\s+//, s/\s+$// for $key, $val; print("[$key:$val]\n"); }
both do the trick.
In Section
Seekers of Perl Wisdom