why are you using
s|[\r\n]|<br />|g;
instead of
s/[\r\n]/\<br \>/g;

are the pipes somehow more efficient in this case or just more readable?

the other thing i'm wondering about is the square brackets... does that mean  /[asdf\.]/ would search for each of those characters (a, s , d, f and Period) versus the string 'asdf.'

i know they're silly questions but i'm trying to get back up to speed with reading perl ... after about 8 months in visual basic for applications

there were so many REALLY nice things about working in VBA ... for example the editor will automatically fill display a list of the sub objects and methods of the object that you're working with... but then again the number of times i've struggled with the long way around a hash table or an array makes me really glad to be back in PerlScript (with a bit of Win32::OLE)

anyways ... i'm rambling :)


In reply to Re: Re: Simple Question for you guys. by Buckaroo Buddha
in thread converting carriage returns to &lt;br&gt; tags (was: Simple Question for you guys) by Anonymous Monk

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.