<div>I have no idea what your faxstat -r output looks like, but why no collapse all of the white space down to single spaces, then you can split on the singles space:</div>
<div> </div>
<div>$line =~ s/\s+/ /g;</div>
<div> </div>
<div>then you can split on the single space.</div>
<div> </div>
<div>  DB&lt;3&gt; $line = &#39;a b  c   d     e       f&#39;;</div>
<div>  DB&lt;4&gt; $a=$line</div>
<div>  DB&lt;5&gt; $a =~ s/\s+/ /g;</div>
<div>  DB&lt;6&gt; p $a<br> a  b  c  d  e  f</div>
<div>  DB&lt;7&gt; @a=split(&quot; &quot;, $a);</div>
<div><br>  DB&lt;8&gt; x @a<br>0  &#39;a&#39;<br>1  &#39;b&#39;<br>2  &#39;c&#39;<br>3  &#39;d&#39;<br>4  &#39;e&#39;<br>5  &#39;f&#39;</div>
<div> </div>
<div> </div>
<div>ydy<br><br></div>
<div class="gmail_quote">On Tue, Mar 2, 2010 at 8:46 AM, Richard Reina <span dir="ltr">&lt;<a href="mailto:richard@rushlogistics.com">richard@rushlogistics.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I&#39;m sorry for asking what likely should be a simple question but after spending a fair amount of time playing with qw(), split(), join(), etc. I still have not figured it out.<br>
<br>I have some fairly messy system output which I have managed to isolate into a scalar with<br><br>use strict;<br>my @received = `faxstat -r`;<br><br>I can&#39;t figure out how to neatly get this into an array so I can get the output into a database table;<br>
<br>I&#39;ve gotten this far;<br><br>my $line;<br>my @fax;<br><br>foreach $line (@received) {<br><br>   if (substr($line,0,5) eq &quot;-rw---&quot;) { # make sure it&#39;s an actual fax<br>                                        # and not the title of the output<br>
       chomp($line);<br>   }<br>}<br><br>$line is exactly what I want but it&#39;s in the form of a scalar;  When I try to split it up into elements of an array with @fax=split(&quot;&quot;, $line); it does not work due to all the back to back white spaces.  If anyone can help me out with a better way to do this I would really appreciate it.<br>
<br>Thanks,<br><br>Richard<br>_______________________________________________<br>Chicago-talk mailing list<br><a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>I take the &quot;Shhhh&quot; out of IT - ydy<br>