[29343] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 587 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 27 09:09:54 2007

Date: Wed, 27 Jun 2007 06:09:06 -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, 27 Jun 2007     Volume: 11 Number: 587

Today's topics:
        about condensed regular expression syntax  raksha34@gmail.com
    Re: about condensed regular expression syntax <jurgenex@hotmail.com>
        Help needed to send and receive mails through Perl in W  kowtham@gmail.com
        Memcache'ing of ip prefixes <siechna@gmail.com>
        new CPAN modules on Wed Jun 27 2007 (Randal Schwartz)
        Perl 2exe and locale?! <kill@spam.edu>
    Re: Problem with autoincrement and strings with spaces <bik.mido@tiscalinet.it>
    Re: strings with formatted characters in %ARGV <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 27 Jun 2007 05:52:05 -0700
From:  raksha34@gmail.com
Subject: about condensed regular expression syntax
Message-Id: <1182948725.319898.174160@k29g2000hsd.googlegroups.com>

hi all,

i have to match the following types of strings:

PTY
IN_B
IN[3]
ADD<2>
SUM{25}
MULT(9)

Here's my attempt at condensing the regular expression:

use strict;
use warnings;

my @Data = qw(
	PTY
	COUNT2
	IN_B
	IN[3]
	ADD<2>
	SUM{25}
	MULT(9)
);

my %h = qw(
	[	]
	{	}
	(	)
	<	>
);

my $pin_re = q/\A[a-zA-Z]\w*(?:([<[({])\d+$h{\1})?\z/;

for my $var (@Data) {
    if ($var =~ m/$pin_re/) {
	print "$var match";
    }
    else {
	print "$var NOmatch";
    }
}
**************************** END of CODE **************

This is what if get:

PTY match
COUNT2 match
IN_B match
IN[3] NOmatch
ADD<2> NOmatch
SUM{25} NOmatch
MULT(9) NOmatch
****************************** END of OUTPUT **********

The reason for writing the regular expression in this format
was to avoid having to use a lot ORs.

but it doesnt work.

Can you suggest someway of fixing this?

Thanks,
Rakesh



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

Date: Wed, 27 Jun 2007 13:01:44 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: about condensed regular expression syntax
Message-Id: <Yctgi.9674$9b5.48@trndny05>

raksha34@gmail.com wrote:
> i have to match the following types of strings:
>
> my @Data = qw(
> PTY
> COUNT2
> IN_B
> IN[3]
> ADD<2>
> SUM{25}
> MULT(9)
> );

The RE
    /.+/
will perfectly match those strings.

It will also match a few other strings, quite a few actually, but as you 
didn't specify any criteria for what strings not to match that should be ok.

jue 




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

Date: Wed, 27 Jun 2007 03:49:14 -0700
From:  kowtham@gmail.com
Subject: Help needed to send and receive mails through Perl in Windows
Message-Id: <1182941354.396409.225190@u2g2000hsc.googlegroups.com>

I have installed ActivePerl 5.8.8 in my Win'XP system. I have
installed lot of modules for that.....but none of the modules is
woking for me to send and receive mails as my configuration is not
proper. I am not even sure whether it is proper or not. Can anyone
send me which module is best with sample configuration files....

Thanks,
Kowtham.



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

Date: Wed, 27 Jun 2007 00:09:22 -0700
From:  Fangorn <siechna@gmail.com>
Subject: Memcache'ing of ip prefixes
Message-Id: <1182928162.472696.118380@q75g2000hsh.googlegroups.com>

Hi,

My situation is as
follows:

I have a list of ip prefixes with assigned AS numbers. I
aggregated
them, so there are ~120000 of them (prefixes, not as numbers :) ).
I
need to look them up real quick, so I use Net::Patricia and it does
the
job well,
but...

I have multiple processes using the data, and multiple
machines
running the same processes. As the data takes ~20MB in memory, it's
a
little inconvinient to multiply it more than 100
times.

So I thought: MEMCACHE. Or something like this. But it seems
that
memcache is actually suitable for simple key-value assignments, and
I
have no idea how I could use it to store my Net::Patricia
object.

So - my questions
are:

1. Is there a way to store what I already have in memcache and share
it
among
processes?

2. If not - what would be a good way to store ip prefixes, where
good
means: speed efficient (less than one second lookup times!) and
easily
cachable, preferably in memcache, but a 'host only' cache would
be
acceptable.

Let's assume an sql-database is not an option here. Nor is rbldnsd
and
dns txt queries.

--
Best regards,
Daniel
daniel@siechniewicz.com



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

Date: Wed, 27 Jun 2007 04:42:12 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Jun 27 2007
Message-Id: <JKA2EC.spA@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Acme-Monkey-4.98
http://search.cpan.org/~bluefeet/Acme-Monkey-4.98/
Monkeys here, monkeys there, MONKEYS everywhere! 
----
Acme-Monkey-4.99
http://search.cpan.org/~bluefeet/Acme-Monkey-4.99/
Monkeys here, monkeys there, MONKEYS everywhere! 
----
App-CamelPKI-0.01
http://search.cpan.org/~grm/App-CamelPKI-0.01/
A multi-purpose PKI. 
----
BatchSystem-SBS-0.33
http://search.cpan.org/~alexmass/BatchSystem-SBS-0.33/
a Simple Batch System 
----
BatchSystem-SBS-0.34
http://search.cpan.org/~alexmass/BatchSystem-SBS-0.34/
a Simple Batch System 
----
Bio-Das-Lite-1.051
http://search.cpan.org/~rpettett/Bio-Das-Lite-1.051/
Perl extension for the DAS (HTTP+XML) Protocol (http://biodas.org/) 
----
CGI-Application-Plugin-ErrorPage-1.10
http://search.cpan.org/~markstos/CGI-Application-Plugin-ErrorPage-1.10/
A simple error page plugin for CGI::Application 
----
CGI-Capture-1.07
http://search.cpan.org/~adamk/CGI-Capture-1.07/
Meticulously thorough capture and replaying of CGI calls 
----
CGI-Capture-1.08
http://search.cpan.org/~adamk/CGI-Capture-1.08/
Meticulously thorough capture and replaying of CGI calls 
----
CGI-Ex-2.17
http://search.cpan.org/~rhandom/CGI-Ex-2.17/
CGI utility suite - makes powerful application writing fun and easy 
----
Continuity-0.94
http://search.cpan.org/~awwaiid/Continuity-0.94/
Abstract away statelessness of HTTP using continuations, for stateful Web applications 
----
DBIx-Class-Schema-Loader-0.04001
http://search.cpan.org/~blblack/DBIx-Class-Schema-Loader-0.04001/
Dynamic definition of a DBIx::Class::Schema 
----
DBIx-Placeholder-Named-0.06
http://search.cpan.org/~izut/DBIx-Placeholder-Named-0.06/
DBI with named placeholders 
----
Digest-SHA-5.45
http://search.cpan.org/~mshelor/Digest-SHA-5.45/
Perl extension for SHA-1/224/256/384/512 
----
Digest-SHA-PurePerl-5.45
http://search.cpan.org/~mshelor/Digest-SHA-PurePerl-5.45/
Perl implementation of SHA-1/224/256/384/512 
----
Google-Checkout-1.0.8
http://search.cpan.org/~dzhuo/Google-Checkout-1.0.8/
----
HTTP-MobileUserID-0.02
http://search.cpan.org/~miyazaki/HTTP-MobileUserID-0.02/
mobile user ID is returned 
----
Image-Magick-Thumbnail-PDF-1.09
http://search.cpan.org/~leocharre/Image-Magick-Thumbnail-PDF-1.09/
make thumbnail of a page in a pdf document 
----
MRTG-Config-0.02
http://search.cpan.org/~sscaffidi/MRTG-Config-0.02/
Perl module for parsing MRTG configuration files 
----
MasonX-MiniMVC-0.01
http://search.cpan.org/~skud/MasonX-MiniMVC-0.01/
Very simple MVC framework for HTML::Mason 
----
Mobile-P2kMoto-0.01
http://search.cpan.org/~mbarbon/Mobile-P2kMoto-0.01/
interface with Motorola P2K phones 
----
Module-Depends-0.13
http://search.cpan.org/~rclamp/Module-Depends-0.13/
identify the dependencies of a distribution 
----
Module-PortablePath-0.04
http://search.cpan.org/~rpettett/Module-PortablePath-0.04/
Perl extension follow modules to exist in different non-core locations on different systems without having to refer to explicit library paths in code. 
----
MooseX-Getopt-0.04
http://search.cpan.org/~stevan/MooseX-Getopt-0.04/
A Moose role for processing command line options 
----
Net-DVBStreamer-Client-0.01
http://search.cpan.org/~njh/Net-DVBStreamer-Client-0.01/
----
Net-MRIM-0.4
http://search.cpan.org/~aau/Net-MRIM-0.4/
Perl implementation of mail.ru agent protocol 
----
Net-MRIM-0.5
http://search.cpan.org/~aau/Net-MRIM-0.5/
Perl implementation of mail.ru agent protocol 
----
Object-InsideOut-3.19
http://search.cpan.org/~jdhedden/Object-InsideOut-3.19/
Comprehensive inside-out object support module 
----
Path-Lite-0.01
http://search.cpan.org/~rkrimen/Path-Lite-0.01/
A lightweight but featureful class for UNIX-style path manipulation. 
----
Regexp-Wildcards-0.06
http://search.cpan.org/~vpit/Regexp-Wildcards-0.06/
Converts wildcard expressions to Perl regular expressions. 
----
SMS-AQL-0.03
http://search.cpan.org/~bigpresh/SMS-AQL-0.03/
Perl extension to send SMS text messages via AQ's SMS service 
----
Slay-Makefile-0.02
http://search.cpan.org/~nodine/Slay-Makefile-0.02/
Wrapper to Slay::Maker that reads the rules from a file 
----
Slay-Maker-0.03
http://search.cpan.org/~nodine/Slay-Maker-0.03/
An perl make engine using perl code for rules 
----
Slay-Maker-0.04
http://search.cpan.org/~nodine/Slay-Maker-0.04/
An perl make engine using perl code for rules 
----
Test-GreaterVersion-0.005
http://search.cpan.org/~ggoldbach/Test-GreaterVersion-0.005/
Did you update the VERSION? 
----
Test-Reporter-1.29_01
http://search.cpan.org/~fox/Test-Reporter-1.29_01/
sends test results to cpan-testers@perl.org 
----
Test-Reporter-1.29_02
http://search.cpan.org/~fox/Test-Reporter-1.29_02/
sends test results to cpan-testers@perl.org 
----
WebService-CRUST-0.3
http://search.cpan.org/~heschong/WebService-CRUST-0.3/
A lightweight Client for making REST calls 
----
YAML-LibYAML-0.26
http://search.cpan.org/~ingy/YAML-LibYAML-0.26/


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 27 Jun 2007 10:56:27 +0200
From: "Ricardo" <kill@spam.edu>
Subject: Perl 2exe and locale?!
Message-Id: <f5t8ns$mkv$1@achot.icm.edu.pl>

Hello,
I have written a script listing files in a folder tree. In order to sort the 
list properly (i.e. taking national characters into consideration) I am 
using pragma "use locale". The script works just fine (ActiveState Perl 
5.6.1, WinXP Pro Polish).Unfortunately after conversion into EXE using 
perl2exe v.8.70 the "locale" functionality seems to be gone!? Can you help 
me with that please?
Thanks in advance for any help you can offer.
Kindest regards from Poland,
-- 
Ricardo
 



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

Date: Wed, 27 Jun 2007 11:26:07 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Problem with autoincrement and strings with spaces
Message-Id: <09b4839e0qmegnnm7n1mqu8hd3n4bovou5@4ax.com>

On Tue, 26 Jun 2007 21:07:05 GMT, Uri Guttman <uri@stemsystems.com>
wrote:

>actually it is not too hard. just use the /e modifier on an
>s///. something like this to incrmenent a trailing substring (untested):
>
>s/(\w+)$/ my $s = $1 ; ++$s/e ;

Tested:

  errol:~ [11:24:57]$ perl -le '$_="foo bar";
  {print,s/(\w+)$/ my $s = $1 ; ++$s/e,<>,redo}'
  foo bar
  
  foo bas
  
  foo bat
  
  foo bau
  
  foo bav
  
  foo baw


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 27 Jun 2007 11:19:38 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: strings with formatted characters in %ARGV
Message-Id: <0qa483lj4a47octcrihj3vqvs1siv1c7l1@4ax.com>

On Tue, 26 Jun 2007 14:12:55 -0700, "Clenna Lumina"
<savagebeaste@yahoo.com> wrote:

>Note, I noticed that if I passed the arguements without any quoting 
>(./foo.pl 1 2\n3) the "\" would get stripped (I'm guessing my the 
>shell - linux, bash) so perl only sees '1 2n3'... why does the slash get 

Yes, it's the shell.

>stripped? 

Because the shell does so. It has it's own backslash quoting, e.g. to
quote a bare single quote. But it doesn't handle special charachters.
We have to live with that. Period.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

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:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#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 587
**************************************


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