Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
go ahead... be a heretic
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Actually yes. That would solve this problem, and several other similar ones.

Given that whatever was put in place would have to remain notionally backwards compatible--which probably means any new interpolation mechanism is a non-starter but---I'd probably go with:

"some stuff {{ any perl expression here }} more stuff"

Indeed, if I'd been spec'ing Perl 6 interpolation, I think I would have removed all other interpolations in favour of a single 'interpret the block and substitute whatever it produces in its place' construct.

It mildly complicates the simple case " xxx{{ $var }}xxx" instead of "xxx${var}xxx", but in the general case, it would be no more complicated than "xxx@ary[]xxx" or "xxx%hash{}xxx", and the consistancy would greatly simplify the parser.

Indeed, the parsing would become simple enough that most editor syntax highligher parsers would probably be able to pick out embedded interpolation blocks, making them stand out from the surrounding string, and even highlight the embedded code in the usual manner.

For me, the ability to have my editor highlight interpolations, (without resorting to running a second OS as an editor:), would more than make up for the slightly less convenient syntax it would require for the simple case.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^3: what would you like to see in perl5.12? by BrowserUk
in thread what would you like to see in perl5.12? by ysth

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (8)
    As of 2014-04-19 11:05 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (480 votes), past polls