<div dir="ltr"><br><div>For the Curious,  Larry on Denver PM came back with this:</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">That line looks like a line you would get in a CSV file, so I would</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">handle it that way:</span><br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">    use Text::CSV;</span><br style="font-family:arial,sans-serif;font-size:13px">

<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">    my $line = &#39;component1,component2,&quot;This is my, test string&quot;,</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">    component4&#39;;</span><br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">    my $csv = Text::CSV-&gt;new;</span><br style="font-family:arial,sans-serif;font-size:13px">

<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">    $csv-&gt;parse($line) or die $csv-&gt;error_diag();</span><br style="font-family:arial,sans-serif;font-size:13px">

<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">    my @columns = $csv-&gt;fields();</span><br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">At this point, @columns contains:</span><br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">    $columns[0]:  &#39;component1&#39;</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">    $columns[1]:  &#39;component2&#39;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">    $columns[2]:  &#39;This is my, test string&#39;</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">    $columns[3]:  &#39; component4&#39;</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Which worked perfectly.</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Robert</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 3, 2013 at 3:22 PM, Robert L. Harris <span dir="ltr">&lt;<a href="mailto:robert.l.harris@gmail.com" target="_blank">robert.l.harris@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div>*Sorry for the OT but my only perl lists have gone dark a long time ago*<div><br></div><div>

<br></div><div>$String=&#39;component1,component2,&quot;This is my, test string&quot;, component4&#39;;</div>
<div><br></div><div>($C1, $C2, $Str, $C4) = split(&#39;,&#39;, $String);</div><div><br></div><div>I&#39;m only getting &quot;This is my&quot; in $Str and $C4 does not contain &quot;component4&quot;.  Is there a graceful way of handling this?  It&#39;s a 1 in 10000 chance it&#39;ll break but accuracy counts.</div>

<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Robert</div><div><br clear="all"><div><br></div>-- <br>:wq!<br>---------------------------------------------------------------------------<br>Robert L. Harris<br><br>DISCLAIMER:<br>      These are MY OPINIONS             With Dreams To Be A King,<br>


       ALONE.  I speak for                      First One Should Be A Man<br>       no-one else.                                     - Manowar
</div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>:wq!<br>---------------------------------------------------------------------------<br>Robert L. Harris<br><br>DISCLAIMER:<br>      These are MY OPINIONS             With Dreams To Be A King,<br>

       ALONE.  I speak for                      First One Should Be A Man<br>       no-one else.                                     - Manowar
</div>