You can use <tt>@ARGV &amp;&amp; $ARGV&#91;0&#93; eq "-h"</tt> in your signature. You can certainly consider this a bug. Note, however, that using <code> tags in your signature would result in the contained text being appended whenever anyone uses the "d/l code" link to grab any code you posted.

In addition to what you used, you can use <code></co</code><code>de></code> to get </code>. In real code, you can use many different techniques:

warn "Found <code>...</co"."de>\n" if "s#<code>(.*?)<\/code>#escape($1)#e;
Unfortunately, providing more alternatives for escaping </code> inside of <code> tags requires the designation of some escaping mechanism which then forces us to require that any code containing this escaping mechanism escape it. Which means there are more instances of code where special tricks have to be done.

As you've already noticed, allowing & to be used to escape characters would cause major problems. We'd have to make the escaping mechanism rather long and something very unlikely to appear in existing code and yet something that people might realize requires special processing. It'd be best if use of this escaping mechanism would result in "invalid" mark-up under the old rules.

For example, you could designate that </code></code> is used to escape </code> inside of <code> tags. Which means that you could then use <code></code></code></code> to get </code>. Doesn't look too good, eh? I'm not convinced it is worth the effort to try to add something like this. (:

        - tye (but my friends call me "Tye")

In reply to (tye)Re: escaping square brackets within signatures? by tye
in thread escaping square brackets within signatures? by Adze

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.