[32272] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3539 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 10 06:09:20 2011

Date: Thu, 10 Nov 2011 03: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           Thu, 10 Nov 2011     Volume: 11 Number: 3539

Today's topics:
    Re: backreferences to two sets of slashes <ben@morrow.me.uk>
    Re: Filename variable going away <stevem_@nogood.com>
    Re: Filename variable going away <news@lawshouse.org>
    Re: Filename variable going away <stevem_@nogood.com>
    Re: time-lag after DBI->commit xhoster@gmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 09 Nov 2011 12:12:32 -0600
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: backreferences to two sets of slashes
Message-Id: <yvWdnbOsvd8NXyfTnZ2dnUVZ7sidnZ2d@bt.com>


Quoth Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>:
> In <A9WdncvO9YoSlirTnZ2dnUVZ8nKdnZ2d@bt.com>, on 11/06/2011
>    at 04:34 PM, Ben Morrow <ben@morrow.me.uk> said:
> 
> >(I don't know if you realise this, but /\d/ matches a lot more than
> >/[0-9]/.)
> 
> From perlrequick
> 
> "Perl has several abbreviations for common character classes: 
> 
> \d is a digit and represents"
> 
>     [0-9]
> 
> That hasn't changed from 5.8.0 to 5.10.0. Has it changed in 5.12 or
> 5.14? Or is it simply wrong when dealing with Unicode?

That has been wrong since 5.8.0. (Since IIRC perlrequick didn't even
exist then, that's quite the oversight.)

From 5.8.0 to <5.14.0, \d (and \s and \w) have rather unreliable
sematics. Sometimes they match in ASCII mode, with the definitions you
or I would expect ([0-9], [ \t\n\r\f], [A-Za-z0-9_] respectively) and
sometimes they match in Unicode mode, matching all Unicode digits/
words/whitespace. Which mode they match in depends on a large variety of
things many of which are not easily predictable; for instance, with any
5.8 through 5.12 we get

    perl -e'
        my $x = "\xc0"; 
        warn $x =~ /\w/ ? "ASCII" : "Unicode";
        my $y = substr "\x{c0}\x{100}", 0, 1;
        warn $y =~ /\w/ ? "ASCII" : "Unicode";
    '
    ASCII at -e line 1
    Unicode at -e line 1

despite the fact that the two strings end up with nominally the same
contents. The rule is not even as simple as 'check the SvUTF8 flag on
the matched string', though: the SvUTF8 flag on the pattern makes a
difference, too, and IIRC some escapes like \N also always force Unicode
matching. This makes those three escapes effectively useless, which is a
shame.

This was, eventually, agreed to be a bug, and was, eventually, fixed in
5.14. From 5.14.0 on you can reliably use /\d/a to get ASCII semantics
and /\d/u to get Unicode semantics; 5.14's perlre has an extensive
discussion of the available options (none of which are as simple as you
might think, since case-insensitive matching in Unicode is Complicated).
Unfortunately the /a flag didn't exist prior to 5.14, so portable code
will have to fall back to [0-9] for quite some time to come.

Ben



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

Date: Tue, 08 Nov 2011 08:13:47 -0800
From: Steve May <stevem_@nogood.com>
Subject: Re: Filename variable going away
Message-Id: <fBcuq.8911$V07.129@newsfe22.iad>

On 11/08/2011 05:28 AM, Rainer Weikusat wrote:
> Steve May<stevem_@nogood.com>  writes:
>> On 11/07/2011 12:54 PM, Steve May wrote:
>>> Maybe a poor title, but this has been driving me nuts for about an hour
>>> now.....

<snip>
>
> It is silly to complain about a problem without saying what the
> problem actually is and even more silly to post random mock-up code
> that doesn't demonstrate the problem alongside of the content-free
> complaint.
>

Thank you for your insightful comments. :-)

\s


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

Date: Tue, 08 Nov 2011 17:48:59 +0000
From: Henry Law <news@lawshouse.org>
Subject: Re: Filename variable going away
Message-Id: <7s6dnfEjwpQR9iTTnZ2dnUVZ8iKdnZ2d@giganews.com>

On 08/11/11 16:13, Steve May wrote:
> On 11/08/2011 05:28 AM, Rainer Weikusat wrote:

>> that doesn't demonstrate the problem alongside of the content-free
>> complaint.
>
> Thank you for your insightful comments. :-)

I sense your irritation; please think again.  Rainer has a certain way 
about him, which doesn't endear him to the group, but in this case he's 
absolutely right.  The only way to get really high-quality help (and 
people of the highest quality hang out here, not excluding the author of 
the language himself) is to do what Rainer says, and what it says in the 
posting guidelines: *post something that can be run by anyone and that 
fails in the way you're describing*

This doesn't mean the original code, proprietary or otherwise.  It means 
a cut-down version, anonymised if necessary and with as many external 
things stubbed out as possible.  And the very cutting-down will often 
help you to find the problem.  As you're cutting down your real code 
suddenly something happens which gives you an insight into your own problem.

-- 

Henry Law            Manchester, England


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

Date: Tue, 08 Nov 2011 10:40:26 -0800
From: Steve May <stevem_@nogood.com>
Subject: Re: Filename variable going away
Message-Id: <JKeuq.17753$jK1.2322@newsfe17.iad>

On 11/08/2011 09:48 AM, Henry Law wrote:
> On 08/11/11 16:13, Steve May wrote:
>> On 11/08/2011 05:28 AM, Rainer Weikusat wrote:
>
>>> that doesn't demonstrate the problem alongside of the content-free
>>> complaint.
>>
>> Thank you for your insightful comments. :-)
>
> I sense your irritation;

Irritation?

Ah... well, I guess the smiley face didn't get my amusement across. I 
realize that the 'seriousness' here is high, but I thought I'd danced 
around that.

Guess not.

Sorry about that. It seems my communication skills have suffered along 
with everything else this last year or so.


> The only way to get really high-quality help (and
> people of the highest quality hang out here, not excluding the author of
> the language himself) is to do what Rainer says, and what it says in the
> posting guidelines: *post something that can be run by anyone and that
> fails in the way you're describing*
>

Agreed.

> This doesn't mean the original code, proprietary or otherwise. It means
> a cut-down version, anonymised if necessary and with as many external
> things stubbed out as possible. And the very cutting-down will often
> help you to find the problem. As you're cutting down your real code
> suddenly something happens which gives you an insight into your own
> problem.
>

Of course, this problem turned out to be (mostly) a non-Perl problem.

paths/permissions were NOT what I expected and... well, it was a mess.

I mostly posted the original in a fit of frustration, and I doubted I 
should at the time. But once you hit that send button....

Hell to get old and stupid(er) to begin with and then add in multiple 
heart attacks, mini-strokes, drugs to prevent more of the same, etc. and 
a person gets *really* loony.

I'll just go back to lurking now, thanks. :-)

\s


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

Date: 09 Nov 2011 01:45:13 GMT
From: xhoster@gmail.com
Subject: Re: time-lag after DBI->commit
Message-Id: <20111108204513.127$ry@newsreader.com>

"dn.perl@gmail.com" <dn.perl@gmail.com> wrote:
> One correction: The database in question is MySQL, not Oracle.

Well, there is a big difference.  Which storage engine are you using with
MySQL?  Not one of the transactional ones, I bet.


> What exactly is happening here? I would expect ($dbh->commit) to take
> 40-50 seconds if that is what it takes, but the moment the perl script
> exits, in my MySQL client, I should see 90,000 rows in the table; no?
> Why the delay?

It sounds like you are expecting transactional behavior from a
non-transactional application.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

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 3539
***************************************


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