in reply to Parsing 'key=value' from incoming message "template"

I think this will work. Needs a lot of cleanup, but I think you can see the algo I'm using. (In purticular, the corner case should be at the top of the loop instead of the bottom, and it should be refactored into a sub.)

#!perl use warnings; use strict; use IO::File; my @data; { my $fh = new IO::File "<testwrap.txt" or die "Can't open: $!"; @data = <$fh>; } my $line=""; my @unwrappeddata; foreach (@data) { chomp $_; if (m/^[^\s=]+\s+=\s+/) { $line .= "\n"; push @unwrappeddata, $line; print $line; $line = $_; } else { $line .= $_; } } $line .= "\n"; push @unwrappeddata, $line; print $line;


Confession: It does an Immortal Body good.