Maybe I'm getting senile before my time here, but I am not sure what you are asking.

Looking at the regex you are the first change I would propose would be the use of s/\s+(.*)$/$z3leu $z$leu $z1leu $1/ in your substitution. I set up a quick test that looks like:

$done=0; while (<DATA>){ $_ =~ s/\s+(.*)$/$1/ unless $done; print; $done=1; } __END__ 0.123 0.654 - so write before these values only 0.987 0.678
just to prove out the regex. However, I don't know what those other variables are about.

Note that I have a "flag" set to make it only act on the first line.

I hope this helps, but I'm not 100% sure what you are after...


In reply to Re: substitutions on a single line by blue_cowdawg
in thread substitutions on a single line by indie_campbell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.