Mmm, Golf...<br><br>use IO::All;io($OUTPUTFILE)->append($_)for map{tr/ /|/s;$_}io($PRODUCTLINE)->slurp<br><br><div class="gmail_quote">On Fri, Oct 14, 2011 at 8:47 PM, Devin Ben-Hur <span dir="ltr"><<a href="mailto:dbenhur@whitepages.com">dbenhur@whitepages.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 10/14/2011 04:01 PM, Noah Rømer wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you don't want<br>
to condense multiple spaces into a single '|' ('    ' ->  '|'), but want<br>
a '|' for each space char ('    ' ->  '||||'), then the 'tr' command is<br>
your friend<br>
<br>
tr/ /|/;<br>
<br>
This will replace every space found with a pipe character.<br>
</blockquote>
<br>
<br></div>
Perl's transliterate will happily condense multiple substitutions to the same character. The squash option tells it to do so: tr/ /|/s;<div><div></div><div class="h5"><br>
______________________________<u></u>______________________________<u></u>_<br>
Seattle Perl Users Group Mailing List<br>
    POST TO: <a href="mailto:spug-list@pm.org" target="_blank">spug-list@pm.org</a><br>
SUBSCRIPTION: <a href="http://mail.pm.org/mailman/listinfo/spug-list" target="_blank">http://mail.pm.org/mailman/<u></u>listinfo/spug-list</a><br>
   MEETINGS: 3rd Tuesdays<br>
   WEB PAGE: <a href="http://seattleperl.org/" target="_blank">http://seattleperl.org/</a><br>
</div></div></blockquote></div><br>