FWIW, heredocs aren't ugly :) if text is more than one line, heredocs are my first choice, of the form

my $html = <<'__HTML__'; __HTML__ my $xml = <<'__XML__'; __XML__ my $foo = <<'__EOF__'; __EOF__

I've often pasted multiline text and had to adjust the delimiters, ditching '' and "" and {} for q~~. With heredocs this is very rare. I've had HERE or EOF show up a few times, but virtually never __EOF__, which I also like for its similarity to __DATA__ and __END__

Its part of my template, I even have a hotkey in my editor for heredocs

I also prefer  qw' l i s t ' or  qw/ l i s t/ because no shift key is involved, and its all pinky action (on QWERTY keyboard),  use CGI 3.55 qw/ param /;  use Data::Dump qw' dd ';

for oneliner portability, i prefer qq// and q//, much easier to move between shells , only have to change leading/trailing "" into '' and vice versa

For match/substitution, i prefer  s/// and then to avoid leaning toothpick syndrome i switch to one of  s;;;  s=== depending on the regex, similarly because shift isn't required, and its all pinky action :)

for larger regex I always use balanced  s{}{}ex; or

s{ }{ }ex;

though the options are ridiculous :D

perl -MO=Deparse -e " s///g " perl -MO=Deparse -e " s\\\g " perl -MO=Deparse -e " s[][]g " perl -MO=Deparse -e " s()()g " perl -MO=Deparse -e " s{}{}g " perl -MO=Deparse -e " s!!!g " perl -MO=Deparse -e " s###g " perl -MO=Deparse -e " s vvvg " perl -MO=Deparse -e " s ___g " perl -MO=Deparse -e " s {}//g " perl -MO=Deparse -e " s {}\\g " perl -MO=Deparse -e " s {}vvg " perl -MO=Deparse -e " s {}()g " perl -MO=Deparse -e " s {}[]g " perl -MO=Deparse -e " s {}<>g " perl -MO=Deparse -e " s<><>g "

you're correct, you definitely want to avoid alphanumeric for delimiters, esp fancy unicode


In reply to Re: Quote and Quote-like Operators by Anonymous Monk
in thread Quote and Quote-like Operators by Xiong

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.