[32110] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3375 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 4 21:09:27 2011

Date: Wed, 4 May 2011 18:09:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 4 May 2011     Volume: 11 Number: 3375

Today's topics:
    Re: FAQ flood MUST end <justin.1104@purestblue.com>
    Re: FAQ flood MUST end <brian.d.foy@gmail.com>
    Re: FAQ flood MUST end <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: FAQ flood MUST end <kst-u@mib.org>
    Re: FAQ flood MUST end <john@castleamber.com>
    Re: FAQ flood MUST end <john@castleamber.com>
    Re: FAQ flood MUST end <kst-u@mib.org>
    Re: FAQ flood MUST end <kst-u@mib.org>
        Inlining the package that implements a source filter wi <koszalekopalek@interia.pl>
    Re: Inlining the package that implements a source filte <uri@StemSystems.com>
    Re: Inlining the package that implements a source filte <nospam-abuse@ilyaz.org>
        perl programming language <r@thevoid1.net>
        Sandboxing re <john@castleamber.com>
    Re: Sandboxing re <john@castleamber.com>
        UK postcode validation <bytebrothers.uk@gmail.com>
    Re: UK postcode validation <uri@StemSystems.com>
    Re: UK postcode validation <jurgenex@hotmail.com>
    Re: UK postcode validation <bugbear@trim_papermule.co.uk_trim>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 4 May 2011 11:57:20 +0100
From: Justin C <justin.1104@purestblue.com>
Subject: Re: FAQ flood MUST end
Message-Id: <g1o798-2ou.ln1@zem.masonsmusic.co.uk>

On 2011-05-03, John Bokma <john@castleamber.com> wrote:
> Justin C <justin.1104@purestblue.com> writes:
>>
>> I suggested a vote, I've not seen many support your argument though
>> there have been posts in support of the status quo therefore the FAQ
>> still gets posted, let's move on.
>
> Oh, I don't care one way or another. And it's not about the FAQ, despite
> the subject, it's about the posting guide lines. I just want to make it
> clear that it most likely has been pointless to post such a thing for at
> least 15 years.

My main concern with the Posting Guidelines is the length of the
document and the difficulty with identifying when it has changed. I
don't mind re-reading it if it's changed but I don't want to read the
same document more than once (unless I specifically want to look
something up). I don't mind at all that it's posted once a week.

   Justin.

-- 
Justin C, by the sea.


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

Date: Wed, 04 May 2011 08:28:17 -0500
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ flood MUST end
Message-Id: <040520110828172298%brian.d.foy@gmail.com>

In article <87iptrg5ga.fsf@castleamber.com>, John Bokma
<john@castleamber.com> wrote:

> As for the FAQ: I think it wouldn't be bad to stop posting the very
> obvious / very outdated ones (e.g. variable suicide) and keep posting
> the recently updated / interesting ones.

I think it would be pretty hard to come up with that list,  either way.
I've been surprised at the corrections I've received for answers that I
thought would never change, and I wouldn't want to lose out on that.

I am keeping a list of candidates for deletion from the FAQ though. If
you think you've found one of those, reply to make a note of it and
I'll add it to my list. Now that we're just about at Perl 5.14, it's
probably a good time to cut out things like "variable suicide" and
other really old things.


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

Date: Wed, 4 May 2011 07:58:50 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: FAQ flood MUST end
Message-Id: <a66898xt9r.ln2@goaway.wombat.san-francisco.ca.us>

On 2011-05-04, brian d foy <brian.d.foy@gmail.com> wrote:
> I am keeping a list of candidates for deletion from the FAQ though. If
> you think you've found one of those, reply to make a note of it and
> I'll add it to my list. Now that we're just about at Perl 5.14, it's
> probably a good time to cut out things like "variable suicide" and
> other really old things.

Would these old items be deleted from the FAQ altogether, or simply
excluded from those that get posted to the newsgroup?  I'm not asking to
express a preference, just to know what to expect.

--keith


-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



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

Date: Wed, 04 May 2011 08:32:26 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: FAQ flood MUST end
Message-Id: <lnk4e6trat.fsf@nuthaus.mib.org>

John Bokma <john@castleamber.com> writes:
[...]
> As for the FAQ: I think it wouldn't be bad to stop posting the very
> obvious / very outdated ones (e.g. variable suicide) and keep posting
> the recently updated / interesting ones.

I think posting them is the best way to identify and correct them.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


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

Date: Wed, 04 May 2011 11:33:19 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: FAQ flood MUST end
Message-Id: <8739ku77e8.fsf@castleamber.com>

brian d foy <brian.d.foy@gmail.com> writes:

> In article <87iptrg5ga.fsf@castleamber.com>, John Bokma
> <john@castleamber.com> wrote:
>
>> As for the FAQ: I think it wouldn't be bad to stop posting the very
>> obvious / very outdated ones (e.g. variable suicide) and keep posting
>> the recently updated / interesting ones.
>
> I think it would be pretty hard to come up with that list,  either
> way.

Recently updated can be determined by version control?  Maybe if a
recently updated (say last 3 months) entry is posted, put a marker in
the subject?

As for interesting ones that's indeed harder. Someone has to score them
:-)

> I've been surprised at the corrections I've received for answers that I
> thought would never change, and I wouldn't want to lose out on that.
>
> I am keeping a list of candidates for deletion from the FAQ though. If

Maybe moving the outdated ones to a separate "outdated" FAQ. I do think
the variable suicide entry is still good to know about (I do now and
then help customers running on very antique Perl), but not to be
posted here.

> you think you've found one of those, reply to make a note of it and
> I'll add it to my list. Now that we're just about at Perl 5.14, it's
> probably a good time to cut out things like "variable suicide" and
> other really old things.

Thanks brian. I do like the FAQ posts, and read them often enough.

-- 
John Bokma                                                               j3b

Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl & Python Development: http://castleamber.com/


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

Date: Wed, 04 May 2011 11:34:38 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: FAQ flood MUST end
Message-Id: <87y62m5srl.fsf@castleamber.com>

Keith Thompson <kst-u@mib.org> writes:

> John Bokma <john@castleamber.com> writes:
> [...]
>> As for the FAQ: I think it wouldn't be bad to stop posting the very
>> obvious / very outdated ones (e.g. variable suicide) and keep posting
>> the recently updated / interesting ones.
>
> I think posting them is the best way to identify and correct them.

For sure. But I don't think anyone wants to correct the entry on
variable suicide (for example).

-- 
John Bokma                                                               j3b

Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl & Python Development: http://castleamber.com/


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

Date: Wed, 04 May 2011 15:28:41 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: FAQ flood MUST end
Message-Id: <ln8vumt812.fsf@nuthaus.mib.org>

John Bokma <john@castleamber.com> writes:
> Keith Thompson <kst-u@mib.org> writes:
>> John Bokma <john@castleamber.com> writes:
>> [...]
>>> As for the FAQ: I think it wouldn't be bad to stop posting the very
>>> obvious / very outdated ones (e.g. variable suicide) and keep posting
>>> the recently updated / interesting ones.
>>
>> I think posting them is the best way to identify and correct them.
>
> For sure. But I don't think anyone wants to correct the entry on
> variable suicide (for example).

Correcting an entry could mean removing it.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


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

Date: Wed, 04 May 2011 15:31:23 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: FAQ flood MUST end
Message-Id: <ln4o5at7wk.fsf@nuthaus.mib.org>

John Bokma <john@castleamber.com> writes:
[...]
> Maybe moving the outdated ones to a separate "outdated" FAQ. I do think
> the variable suicide entry is still good to know about (I do now and
> then help customers running on very antique Perl), but not to be
> posted here.
[...]

I should have read that before posting my previous followup.

Yes, it makes sense that some FAQs might be worth keeping, but not worth
posting.  On the other hand, posting them here doesn't bother me (and
the first sentence makes it clear that it applies only to old versions
of Perl).

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


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

Date: Wed, 4 May 2011 04:39:13 -0700 (PDT)
From: Koszalek Opalek <koszalekopalek@interia.pl>
Subject: Inlining the package that implements a source filter with Filter::Simple
Message-Id: <ba4ec69f-8613-418f-b6a4-a5242dd55183@28g2000yqu.googlegroups.com>

Hello,

I want to run a simple s/// on my source code. (I want to inline some
operations in several comparision functions.) Filter::Simple does what
I want but I would really like to avoid creating a separate .pm file
with the filter. (The filter is going to be used in one place only.)

So I tried this:

#!/usr/bin/perl
use strict;
use warnings;

{
   package MyFilter;
   use Filter::Simple;
   FILTER {
       s/yuppy/blah/g;
   }
};

import MyFilter;
sub test {
   warn "yuppy";
}

test();

But it doesn't work. Is there a way to create a filter without
creating
a separate file?
Once I manage to 'inline' the filter, how can I turn it off?

K.


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

Date: Wed, 04 May 2011 07:56:50 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Inlining the package that implements a source filter with Filter::Simple
Message-Id: <87y62mn0fx.fsf@quad.sysarch.com>

>>>>> "KO" == Koszalek Opalek <koszalekopalek@interia.pl> writes:

  KO> I want to run a simple s/// on my source code. (I want to inline
  KO> some operations in several comparision functions.) Filter::Simple
  KO> does what I want but I would really like to avoid creating a
  KO> separate .pm file with the filter. (The filter is going to be used
  KO> in one place only.)

first rule: don't use source filters.
second rule: see first rule.

they are a disaster waiting to happen. all modules that use source
filtering are deprecated since they don't always work depending on too
many factors. simple filtering can't handle perl syntax cleanly.

find another solution. and also it is hard to come up with a problem
where source filtering is the only or best solution.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Wed, 4 May 2011 19:29:20 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Inlining the package that implements a source filter with Filter::Simple
Message-Id: <slrnis3a8g.r4d.nospam-abuse@chorin.math.berkeley.edu>

On 2011-05-04, Koszalek Opalek <koszalekopalek@interia.pl> wrote:
> {
>    package MyFilter;
>    use Filter::Simple;
>    FILTER {
>        s/yuppy/blah/g;
>    }
> };
>
> import MyFilter;

This assumes that

 either $INC{'MyFilter.pm'} is defined, or MyFilter.pm is on @INC;

 MyFilter->export() is defined (THIS might be done by your `use'
 above; do not know).

Then think about what Uri said...

Ilya


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

Date: Wed, 4 May 2011 08:26:45 -0700 (PDT)
From: Robin <r@thevoid1.net>
Subject: perl programming language
Message-Id: <6cc7bc23-d578-403a-8843-04e7a771d573@j31g2000yqe.googlegroups.com>

my programming lang written in perl.

www.thevoid1.net/riel

stop your own life probs.

it is

one thing.
work to heal a lot and walk outside.

-r


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

Date: Wed, 04 May 2011 15:41:27 -0500
From: John Bokma <john@castleamber.com>
Subject: Sandboxing re
Message-Id: <87r58e2o7c.fsf@castleamber.com>


I want to be able to allow users to enter regular expressions. Since
Perl's default re are way too powerful (code execution), is there some
way to sandbox or limit the the capabilities?

I just looked at POSIX::Regexp but it gives a segmentation fault here
(oops, will look futher into it & bug report).

I've noticed that there are several re::engine modules, maybe the Plan9
one is sufficient for my needs.

Any tips are welcome, thanks.

-- 
John Bokma                                                               j3b

Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl & Python Development: http://castleamber.com/


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

Date: Wed, 04 May 2011 15:55:26 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: Sandboxing re
Message-Id: <87iptq2nk1.fsf@castleamber.com>

John Bokma <john@castleamber.com> writes:

> I want to be able to allow users to enter regular expressions. Since
> Perl's default re are way too powerful (code execution), is there some
> way to sandbox or limit the the capabilities?
>
> I just looked at POSIX::Regexp but it gives a segmentation fault here
> (oops, will look futher into it & bug report).
>
> I've noticed that there are several re::engine modules, maybe the Plan9
> one is sufficient for my needs.

Well, that one seems to halt in such a way on an error that Try::Tiny's
try .. catch can't catch the error...

-- 
John Bokma                                                               j3b

Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl & Python Development: http://castleamber.com/


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

Date: Wed, 4 May 2011 08:37:08 -0700 (PDT)
From: Keith <bytebrothers.uk@gmail.com>
Subject: UK postcode validation
Message-Id: <4b14e639-a0ca-48c5-931b-000ab781c362@e35g2000yqc.googlegroups.com>


I recently found this monster on Wikipedia, which validates almost all
UK postcodes, catching all invalid areas, and most invalid districts.
I'm just wondering whether this can be 'cleaned up' or made more
readable for maintainers.  I've had a go today, but it still looks a
mess.  Here's the regex:

'^(GIR 0AA)|(((A[BL]|B[ABDHLNRSTX]?|C[ABFHMORTVW]|D[ADEGHLNTY]|E[HNX]?|
F[KY]|G[LUY]?|H[ADGPRSUX]|I[GMPV]|JE|K[ATWY]|L[ADELNSU]?|M[EKL]?|
N[EGNPRW]?|O[LX]|P[AEHLOR]|R[GHM]|S[AEGKLMNOPRSTY]?|T[ADFNQRSW]|UB|
W[ADFNRSV]|YO|ZE)[1-9]?[0-9]|((E|N|NW|SE|SW|W)1|EC[1-4]|WC[12])[A-
HJKMNPR-Y]|(SW|W)([2-9]|[1-9][0-9])|EC[1-9][0-9]) [0-9][ABD-HJLNP-UW-Z]
{2})$';

I know the space after the initial 'GIR' screws the formatting, but
that really is just one long regex.

Anyone any good at these things?


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

Date: Wed, 04 May 2011 11:46:01 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: UK postcode validation
Message-Id: <87vcxqii4m.fsf@quad.sysarch.com>

>>>>> "K" == Keith  <bytebrothers.uk@gmail.com> writes:

  K> I recently found this monster on Wikipedia, which validates almost all
  K> UK postcodes, catching all invalid areas, and most invalid districts.
  K> I'm just wondering whether this can be 'cleaned up' or made more
  K> readable for maintainers.  I've had a go today, but it still looks a
  K> mess.  Here's the regex:

  K> '^(GIR 0AA)|(((A[BL]|B[ABDHLNRSTX]?|C[ABFHMORTVW]|D[ADEGHLNTY]|E[HNX]?|
  K> F[KY]|G[LUY]?|H[ADGPRSUX]|I[GMPV]|JE|K[ATWY]|L[ADELNSU]?|M[EKL]?|
  K> N[EGNPRW]?|O[LX]|P[AEHLOR]|R[GHM]|S[AEGKLMNOPRSTY]?|T[ADFNQRSW]|UB|
  K> W[ADFNRSV]|YO|ZE)[1-9]?[0-9]|((E|N|NW|SE|SW|W)1|EC[1-4]|WC[12])[A-
  K> HJKMNPR-Y]|(SW|W)([2-9]|[1-9][0-9])|EC[1-9][0-9]) [0-9][ABD-HJLNP-UW-Z]
  K> {2})$';

some quick comments.

use the /x modifier so you can write that over multiple lines and
comment the parts. it will also allow you to show the nested groups
better.

use the (?: ) group but not grab feature which will make it run faster
since it won't copy the grouped parts.

see if Regexp::Common has this already or maybe another cpan module.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Wed, 04 May 2011 08:55:12 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: UK postcode validation
Message-Id: <pit2s6581rove3u0dr09aejj71e8rn665h@4ax.com>

Keith <bytebrothers.uk@gmail.com> wrote:
>
>I recently found this monster on Wikipedia, which validates almost all
>UK postcodes, catching all invalid areas, and most invalid districts.
>I'm just wondering whether this can be 'cleaned up' or made more
>readable for maintainers.  I've had a go today, but it still looks a
>mess.  Here's the regex:
>
>'^(GIR 0AA)|(((A[BL]|B[ABDHLNRSTX]?|C[ABFHMORTVW]|D[ADEGHLNTY]|E[HNX]?|
>F[KY]|G[LUY]?|H[ADGPRSUX]|I[GMPV]|JE|K[ATWY]|L[ADELNSU]?|M[EKL]?|
>N[EGNPRW]?|O[LX]|P[AEHLOR]|R[GHM]|S[AEGKLMNOPRSTY]?|T[ADFNQRSW]|UB|
>W[ADFNRSV]|YO|ZE)[1-9]?[0-9]|((E|N|NW|SE|SW|W)1|EC[1-4]|WC[12])[A-
>HJKMNPR-Y]|(SW|W)([2-9]|[1-9][0-9])|EC[1-9][0-9]) [0-9][ABD-HJLNP-UW-Z]
>{2})$';

Perhaps instead of us having to reverse engineer the RE it would be
easier to provide a specification for valid UK postcodes?

jue


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

Date: Wed, 04 May 2011 17:13:17 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: UK postcode validation
Message-Id: <f8OdnWpGno6A5lzQnZ2dnUVZ7vydnZ2d@brightview.co.uk>

Jürgen Exner wrote:
> Keith<bytebrothers.uk@gmail.com>  wrote:
>>
>> I recently found this monster on Wikipedia
>
> Perhaps instead of us having to reverse engineer the RE it would be
> easier to provide a specification for valid UK postcodes?

http://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom

A spec and regexp.

    BugBear


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

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


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