Nifty.

Skip the first ':;' line. I wouldn't initially guess that a colon with a trailing semicolon and preceeding whitespace is "a line containing just a colon", but there you have it. ;) perlrun discusses replacing a shebang line with : in conjunction with the -S command line option, to start up 'sh' rather than 'csh' on some systems that don't recognize the #! line. The leading whitespace and trailing colon aren't explicitly discussed, and you would think that "line containing just a colon" precludes anything else being on the line. I suppose that looking at the verbage a couple of times I see where "...some systems may have to replace the #! line with a line containing just a colon, which will be politely ignored by Perl." really means that the entire line will be ignored.

Next, $: contains "\n-" normaly as the "Format Line Break Characters" special variable.

Next, $:=~s.... has an embeded newline, so it really looks like, $: =~ s/\n-/;another Perl Hacker /;

Next, chop $: removes the trailing space character.

Next, $: =~ y:;::d; is a funky way of saying, $: =~ tr/;//d, which deletes any ';' characters found. In this case, it's the leading ';' in ';another Perl Hacker'.

Next, print+Just.$:; or in other words, print 'Just' . $: ;, or in other words, print 'Just' . 'another Perl Hacker';

In this case, whitespace is definately relevant!

Dave

"If I had my life to do over again, I'd be a plumber." -- Albert Einstein


In reply to Re: Multi-roled colon by davido
in thread Multi-roled colon by Abigail-II

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.