You would need a keyword or other syntactic marker, since a literal pair before anything else would not know its to be taken as an adverb.

Larry said that :lc would refer to the single use of the operator only, not the whole chain. The parser just could not work to apply it to the whole chain. But putting it first somehow would avoid that problem, so I like the idea in general. Basically, establish the options in a lexical scope and then use the operators as many times as you want.

For strings in particular, contextual variables might be good for controlling the default options. This is not a case of using different accessors -- you would want to compare strings using whatever rules rather than transforming (and copying) the whole string first. Especially when the comparison may decide after only a few characters, and not need to look at the whole string.

In your last example, :lc won't do anything to the numeric comparison. You have a more serious bug of using > where you meant gt. —John


In reply to Re^4: my new article, "A Romp Through Infinity" by John M. Dlugosz
in thread my new article, "A Romp Through Infinity" by John M. Dlugosz

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.