I had thought about this as well, or even making the entire syntax something like $x = $y =~ \s/foo/bar; or something of the sort. To be honest though, everything worked well when I posted this - and I didn't think I was actually parsing too much Perl on my own - but as I expanded, I realized what I wanted to - things like my $foo = sub_returns_string() \~ s/bar/foo/;1 just got too messy and needed too much parsing of Perl, so as much as I love this idea, I've dropped it - for now.

1It seems like there's just increasing complexity to make it 'just work' like people would expect it to. Something like my $foo = subroutine( this => 'contains an equals', $self->{ scalar @array } ) =~ s/a/b/g; although probably would be rarely used, would still need to just work. So I'm really beginning to understand why people shy away from using source filters, because really there is a lot of parsing Perl, even for the simple thing like I wanted to do, where I thought I could isolate the problem and not have to do much.

    -Bryan


In reply to Re^4: A Functional Substitute by mrborisguy
in thread A Functional Substitute by mrborisguy

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.