<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<3> $line = 'a b c d e f';</div>
<div> DB<4> $a=$line</div>
<div> DB<5> $a =~ s/\s+/ /g;</div>
<div> DB<6> p $a<br> a b c d e f</div>
<div> DB<7> @a=split(" ", $a);</div>
<div><br> DB<8> x @a<br>0 'a'<br>1 'b'<br>2 'c'<br>3 'd'<br>4 'e'<br>5 'f'</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"><<a href="mailto:richard@rushlogistics.com">richard@rushlogistics.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I'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't figure out how to neatly get this into an array so I can get the output into a database table;<br>
<br>I've gotten this far;<br><br>my $line;<br>my @fax;<br><br>foreach $line (@received) {<br><br> if (substr($line,0,5) eq "-rw---") { # make sure it'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's in the form of a scalar; When I try to split it up into elements of an array with @fax=split("", $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 "Shhhh" out of IT - ydy<br>