Dermot and I started discussing various topics in this node and I decided it would make more sense to move this to SoPW so more people would see it and it wouldn't be lost forever in Q&A.

So, here are my replies to him -- see the above link for the full context of the conversation.

No need to be embarassed; you didn't do anything wrong. I just wanted to make sure people saw things from all the angles.

No, I wouldn't say fully valid running code is necessarily required, but I do think something like the value of $/ is important info. It seems like just a minor oversight though; definitely not a big deal.

Well, why is the binmode there? An HTML file is a text file, not a "binary" file. I'm no Windows programmer, so I can't say for sure, but I'd think that using binmode on an HTML file would be a bad idea. And I certainly can't see it serving any purpose here.

re is a pragma in the core distribution, and one of the options to it is `debug'. If you `use' it in a program, it will verbosely tell you how the Perl REx engine does its matches.

Here's an example of how you might use it:

[~] $ perl -Mre=debug -we'$_ = "abbaba"; /(.).*?\1/' Freeing REx: `,' Compiling REx `(.).*?\1' size 11 first at 3 1: OPEN1(3) 3: REG_ANY(4) 4: CLOSE1(6) 6: MINMOD(7) 7: STAR(9) 8: REG_ANY(0) 9: REF1(11) 11: END(0) minlen 1 Omitting $` $& $' support. EXECUTING... Matching REx `(.).*?\1' against `abbaba' Setting an EVAL scope, savestack=3 0 <> <abbaba> | 1: OPEN1 0 <> <abbaba> | 3: REG_ANY 1 <a> <bbaba> | 4: CLOSE1 1 <a> <bbaba> | 6: MINMOD 1 <a> <bbaba> | 7: STAR Setting an EVAL scope, savestack=3 1 <a> <bbaba> | 9: REF1 failed... REG_ANY can match 1 times out of 1... 2 <ab> <baba> | 9: REF1 failed... REG_ANY can match 1 times out of 1... 3 <abb> <aba> | 9: REF1 4 <abba> <ba> | 11: END Match successful! Freeing REx: `(.).*?\1'

-dlc


In reply to Discussion of HTML-linkfinding from Q&A section by dchetlin

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.