<font face="courier new,monospace"><br></font><br><div class="gmail_quote">On Wed, Mar 9, 2011 at 2:16 PM, Shaun Fryer <span dir="ltr"><<a href="mailto:sfryer@sourcery.ca">sfryer@sourcery.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">my $strip = qr{;[^\;]+$};<br>
while (<DATA>) {<br>
chomp;<br>
</div> my ($key, $val) = split /=/;<br>
my ($quote) = ($val =~ m{^(["'])}g);<br>
if ($quote) {<br>
($val) = ($val =~ m{^($quote[^\b]+($quote))}g);<br>
}<br>
else {<br>
$val =~ s/$strip//;<br>
}<br>
print $key, '=', $val, "\n";<br>
<div class="im">}<br></div></blockquote><div class="im"><br>Closer, but it still assumes the key=value concept,<br>the goal was 'any trailing comment' (not quoted) ie. regardless of the syntax before it<br>as in the following additional test case:<br>
<br>title ;comment<br></div><br></div>