From daily-tips@perl.org. Might be worthwhile adding this as a resource to the learning perl section on.

Thoughts?

We are at the Perl Conference in San Diego having lots of fun and learning lots of cool new stuff. Be sure to follow the coverage at http://use.perl.org/ and http://www.perl.com/ :-) On to the tip: Anyone have seen code like print "<a href=\"http://$url/\">$site</a> (\"$title\")"; Now, it is quite annoying to read all those \'s, so you would think there is a better way. Well, there is! :-) The above line could be written as print qq[<a href="http://$url/">$site</a> ("$title")]; So instead of using " as the quote operator we used qq[ and ] to end the quote. You can also use for example qq{ (or any other form of "brackets"), li +ke print qq{...}; Like "text" can be substituted with qq[text] you can use a single q for ', so a confusing statement like '\'daily-tips-subscribe@perl.org\'' can be written as q['daily-tips-subscribe@perl.org'] instead. For more information, run "perldoc perlop" and search for "Quote and Quote-like Operators". To unsubscribe: mail daily-tips-unsubscribe@perl.org To subscribe: mail daily-tips-subscribe@perl.org Or visit: http://learn.perl.org/tips/ Comments, suggestions? Send them to ask@perl.org.

"The future will be better tomorrow." ... from the collected wisdom of George W Bush.

Edit Masem 2001-07-27 - CODE Tags


In reply to perl tips 3 by Mungbeans

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.