Re: Teach me how to fish, regexp

From: Sam Holden (sholden_at_flexal.cs.usyd.edu.au)
Date: 10/09/03


Date: 8 Oct 2003 23:15:01 GMT

On Wed, 08 Oct 2003 19:21:02 GMT, Henry <henryn@zzzspacebbs.com> wrote:
>
> That said, I have to say I find the man pages the last place I want to look
> in terms of convenience. I'll have to find a web based... Done!

The risj with that is that the man pages on your system will document
the perl installed on your system. The web versions will document
some version of perl which might not be the one you are using.

Plus the man pages also document the modules you have installed, rather than
a random selection of them...

>
> Ah, much easier. Here's a relevant extract.
>
> ...Setting to "" will treat two or more consecutive empty lines as a single
> empty line. Setting to "\n\n" will blindly assume that the next input
> character belongs to the next paragraph, even if it's a newline. (Mnemonic:
> / delimits line boundaries when quoting poetry.)
>
> Quoting _poetry_?

Why not. It's true after all, and hence a reasonable mnemonic.

>
> The choice of "" as a special is clearly a choice of convenience on the part
> the people doing the internals-- and has no particular mnemonic or symbolic
> values. I'm glad that's clear.

"" and undef are the only two values that could be used as something special,
since everything else is a possible literal end of line marker.

undef as "slurp" mode makes sense, since that's more common than paragraph
mode (in my experience anyway) and being undef means a simple 'local $/;'
is enough to enable it.

That leaves "" for something else, and paragraph mode is a good choice in
my opinion, since it's a reasonably commonly wanted operation.

Of course when references arrived a new possibility became available and
(since it's perl) was used...

-- 
Sam Holden


Relevant Pages

  • Re: Check POP3 E-mail
    ... > Note the sassign and the undef; ... default language, and, from what I've seen, extremely common in business ... COBOL, so I don't know if those required explicit initialization or not, ... I am familiar with Perl; however, ...
    (comp.lang.perl.misc)
  • UTF-8 issues connecting to Oracle
    ... A Google search turned up a known problem with perl on ES 3 and the UTF8 character set. ... <- STORE= 1 at Oracle.pm line 61 ... 'select collection_name from clone_collection' undef) thr#504010 ... <- DESTROY= undef ...
    (perl.dbi.users)
  • FAQ 7.27 How do I clear a package?
    ... undef $$fullname; ... Or, if you're using a recent release of Perl, you can just use the ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ... so please include relevant details for ...
    (comp.lang.perl.misc)
  • FAQ 7.27 How do I clear a package?
    ... undef $$fullname; ... Or, if you're using a recent release of Perl, you can just use the ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ... so please include relevant details for ...
    (comp.lang.perl.misc)
  • FAQ 7.27 How do I clear a package?
    ... undef $$fullname; ... Or, if you're using a recent release of Perl, you can just use the ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ... so please include relevant details for ...
    (comp.lang.perl.misc)