[32312] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3579 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 31 18:09:22 2011

Date: Sat, 31 Dec 2011 15:09:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 31 Dec 2011     Volume: 11 Number: 3579

Today's topics:
    Re: Opening Unicode files? <nospam-abuse@ilyaz.org>
    Re: regexp for matching a string with mandatory undersc <nospam-abuse@ilyaz.org>
    Re: regexp for matching a string with mandatory undersc <nospam-abuse@ilyaz.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 31 Dec 2011 21:52:43 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Opening Unicode files?
Message-Id: <slrnjfv11b.9a3.nospam-abuse@panda.math.berkeley.edu>

On 2011-12-28, r.mariotti@fdcx.net <r.mariotti@fdcx.net> wrote:
>>Same question as to the other answer: does it ship with Perl?  And I
>>do not want any guessing; I want a very deterministic procedure...

> Do as all perl mongers do - use CPAN to locate, download and install
> the needed function.
>
> $>perl -MCPAN -e shell

I never do "as all perl mongers do".  Neither, I expect, do users of
my code.

Hope this helps,
Ilya


------------------------------

Date: Sat, 31 Dec 2011 21:42:02 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: regexp for matching a string with mandatory underscores
Message-Id: <slrnjfv0da.9a3.nospam-abuse@panda.math.berkeley.edu>

On 2011-12-28, Tim McDaniel <tmcd@panix.com> wrote:
>>> /_.*_/ is a _clear_ way to say "more than one underscore" ?
>
> Very clear to me, at least.
>
>>Yes, but it also would match "foo_bar baz_quux" which contains an
>>intervening whitespace.  This would not satisfy the original
>>requirements, which stipulate finding multiple underscores within
>>continuous alphanumeric characters with no intervening whitespace.
>
> Which is why I wrote
>>>>     /^\w+$/ && /_.*_/

The first one is not completely equivalent to !/\W/, but when ANDed
with the second one it is (ignoring the issue with trailing \n, of
course).  Is it more clear?  I'm not sure...

Ilya


------------------------------

Date: Sat, 31 Dec 2011 21:47:25 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: regexp for matching a string with mandatory underscores
Message-Id: <slrnjfv0nd.9a3.nospam-abuse@panda.math.berkeley.edu>

On 2011-12-29, John W. Krahn <jwkrahn@example.com> wrote:
>> In the current case, it's
>>      /_.*_/
>> versus
>>      tr/_//>  1
>> They both use builtins pretty directly and they are both short.
>> Personally, I find the former to be clearer than the latter, which
>> uses an operator that usually causes side effects but doesn't in this
>> case, and I'm still don't know how many know its details.
>
> tr/_// is pretty simple. 

tr is extremely complicated.

> It is actually short for tr/_/_/ which 
> replaces every '_' character with a '_' character and returns the number 
> of replacements made.  It has the advantages that it doesn't interpolate 
> and it only does one thing, and does it well.

For which value of "well"?  If it is applied to 2GB string, would it
make a copy of it?  If the string is tied to a database entry, would
it cause a database update?  If the string is shared between fork()ed
processes, would it become unshared after the operation?

In short: Do you know what you are talking about?

Best wishes for the new year,
Ilya


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 3579
***************************************


home help back first fref pref prev next nref lref last post