[31108] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2353 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 19 16:10:00 2009

Date: Sun, 19 Apr 2009 13: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           Sun, 19 Apr 2009     Volume: 11 Number: 2353

Today's topics:
    Re: dmake.exe: Error: -- 'C:\Perl\libConfig.pm' not fou tuser1@gmail.com
    Re: dmake.exe: Error: -- 'C:\Perl\libConfig.pm' not fou <sisyphus359@gmail.com>
    Re: effienct way to select random value from the hash <whynot@pozharski.name>
    Re: effienct way to select random value from the hash <xhoster@gmail.com>
    Re: I'm looking for a Perl Book... I think. <daves@orpheusmail.co.uk>
        new CPAN modules on Sun Apr 19 2009 (Randal Schwartz)
        Print strings based on regular expression <yong321@yahoo.com>
    Re: What does `my' do?! <xhoster@gmail.com>
    Re: What's wrong with the following regular expression? <haoniukun@gmail.com>
    Re: What's wrong with the following regular expression? <tadmc@seesig.invalid>
    Re: What's wrong with the following regular expression? sln@netherlands.com
    Re: What's wrong with the following regular expression? sln@netherlands.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 19 Apr 2009 03:10:11 -0700 (PDT)
From: tuser1@gmail.com
Subject: Re: dmake.exe: Error: -- 'C:\Perl\libConfig.pm' not found, and can't  be made
Message-Id: <0f20075e-4021-40e9-b0d9-5aef88385c57@k38g2000yqh.googlegroups.com>

On Apr 19, 12:27=A0am, sisyphus <sisyphus...@gmail.com> wrote:
> On Apr 19, 6:30=A0am, tus...@gmail.com wrote:
>
> > dmake.exe: =A0Error: -- `C:\Perl\libConfig.pm' not found
>
> What does 'dmake -V' output ?
>
> With my build of 1004 (where I *don't* have the problem you've
> reported) it outputs:
>
> #########################
> dmake.exe - Version 4.11-20080107-SHAY (Windows / MS Visual C++)
> Copyright (c) 1990,...,1997 by WTI Corp.
>
> Default Configuration:
> =A0 =A0 =A0 =A0 MAXLINELENGTH :=3D 32766
> =A0 =A0 =A0 =A0 MAXPROCESSLIMIT :=3D 4
> =A0 =A0 =A0 =A0 MAXPROCESS :=3D 1
> =A0 =A0 =A0 =A0 .IMPORT .IGNORE: DMAKEROOT
> =A0 =A0 =A0 =A0 .MAKEFILES : makefile.mk makefile
> =A0 =A0 =A0 =A0 .SOURCE =A0 =A0: .NULL
> =A0 =A0 =A0 =A0 DMAKEROOT *=3D $(ABSMAKECMD:d)startup
> =A0 =A0 =A0 =A0 MAKESTARTUP :=3D $(DMAKEROOT)\startup.mk
>
> Please read the NEWS file for the latest release notes.
> #########################
>
> Is there anything athttp://www.perlmonks.org/index.pl?node_id=3D603230
> that helps ? (If so, what ? It would be nice to get to the bottom of
> this error once and for all :-)

Here is my output from "dmake -V", looks identical to yours:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
C:\>dmake -V
dmake.exe - Version 4.11-20080107-SHAY (Windows / MS Visual C++)
Copyright (c) 1990,...,1997 by WTI Corp.

Default Configuration:
        MAXLINELENGTH :=3D 32766
        MAXPROCESSLIMIT :=3D 4
        MAXPROCESS :=3D 1
        .IMPORT .IGNORE: DMAKEROOT
        .MAKEFILES : makefile.mk makefile
        .SOURCE    : .NULL
        DMAKEROOT *=3D $(ABSMAKECMD:d)startup
        MAKESTARTUP :=3D $(DMAKEROOT)\startup.mk

Please read the NEWS file for the latest release notes.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D

According to the article on Perlmonks, here is my output for
ExtUtils::MakeMaker and the contents of the Makefile:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
C:\>perl -MExtUtils::MakeMaker -e "print
$ExtUtils::MakeMaker::VERSION"
Set up gcc environment - 3.4.5 (mingw-vista special r3)
6.42_01

contents of Makefile:
[...]
AR_STATIC_ARGS =3D cr
DIRFILESEP =3D ^\
DFSEP =3D $(DIRFILESEP)
[...]
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D

I then intervened manually in the Makefile and changed

DIRFILESEP =3D ^\

into

DIRFILESEP =3D \\

 ...but now I have a different error message
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
C:\Scalar-Util-Refcount-1.0.2>dmake
dmake.exe:  Error executing 'rem': No such file or directory
dmake.exe:  Error code 255, while making 'blibdirs'
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D


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

Date: Sun, 19 Apr 2009 12:31:10 -0700 (PDT)
From: sisyphus <sisyphus359@gmail.com>
Subject: Re: dmake.exe: Error: -- 'C:\Perl\libConfig.pm' not found, and can't  be made
Message-Id: <6dda32cb-2475-4c2c-a035-1bee1d112e27@f1g2000prb.googlegroups.com>

On Apr 19, 8:10=A0pm, tus...@gmail.com wrote:
> On Apr 19, 12:27=A0am, sisyphus <sisyphus...@gmail.com> wrote:

> I then intervened manually in the Makefile and changed
>
> DIRFILESEP =3D ^\
>
> into
>
> DIRFILESEP =3D \\
>

It's really strange that DIRFILESEP is set to ^\ for you. For me it's
definitely set to \\.
Yet we both have the same build of ActivePerl, the same version of
EU::MM (I also have 6.42_01), the same version of dmake, and the same
MinGW compiler. I wonder what it is that makes the difference.

Did you install ActivePerl from the zip package or the msi package ? I
don't know why that should matter ... just clutching at straws :-)
(I installed from the zip package, btw.)

> ...but now I have a different error message
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> C:\Scalar-Util-Refcount-1.0.2>dmake
> dmake.exe: =A0Error executing 'rem': No such file or directory
> dmake.exe: =A0Error code 255, while making 'blibdirs'

Don't think I've seen that error before.
Could you email me the Makefile ? - to sisyphus1 at (@) optusnet dot
(.) com dot(.) au. (Or post it to some public location where we can
all access it. I suspect it's bad etiquette to post a file of that
size to this newsgroup, though I could be wrong about that.)
I think it would help if we could do a 'diff -u' between the Makefile
you get, and the Makefile I get.

The Makefile I get can be seen at http://www.perlmonks.org/index.pl?viewmod=
e=3Dpublic;node_id=3D587490
for anyone interested.

Cheers,
Rob


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

Date: Sun, 19 Apr 2009 17:14:04 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: effienct way to select random value from the hash
Message-Id: <slrngumcdh.3eh.whynot@orphan.zombinet>

On 2009-04-18, Jürgen Exner <jurgenex@hotmail.com> wrote:
> Eric Pozharski <whynot@pozharski.name> wrote:
*SKIP*
>>And one more point of concern: serializing hash into array is a subject
>>of Perl's own key reordering.  Maybe just do it once?
>
> Hmmm, when would perl reorder the keys? I would assume only when the
> hash itself changes, i.e. when elements are added/removed. And in that
> case probably you want to restart the random sequence anyway.

My point was, that when picking random item of already randomized
sequence, the picked item becomes more or less random?  I don't know.

> But the key question still remains unanswered: is
> serialization/flattening of the hash faster than a keys()?

That's easy

	perl -MBenchmark=cmpthese,timethese -wle '
	my %h = qw| a b c d e f g h i j k l m n |;
	my @ph = %h;
	my $z;
	cmpthese timethese -5, {
	  keys => sub { $z = (keys %h)[2] },
	  flat => sub { $z = (() = %h)[4] },
	  pflt => sub { $z = $ph[4] },
	  };
	'
	Benchmark: 
	running
	 flat, keys, pflt
	 for at least 5 CPU seconds
	...

	      flat:  5 wallclock secs ( 5.07 usr +  0.02 sys =  5.09 CPU) @ 203814.73/s (n=1037417)

	      keys:  5 wallclock secs ( 5.05 usr +  0.01 sys =  5.06 CPU) @ 187490.71/s (n=948703)

	      pflt:  6 wallclock secs ( 5.74 usr +  0.00 sys =  5.74 CPU) @ 1735072.47/s (n=9959316)

		  Rate keys flat pflt
	keys  187491/s   --  -8% -89%
	flat  203815/s   9%   -- -88%
	pflt 1735072/s 825% 751%   --

And, the sequence is the same:

	perl -we '
	my %h = qw| a b c d e f g h i j k l m n |;
	my @ph = %h;
	print "$_ " foreach keys %h;
	print "\n";
	print "$ph[$_ * 2] " for 0 .. $#ph / 2;
	print "\n";
	'
	e c k a g m i 
	e c k a g m i 

-- 
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom


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

Date: Sun, 19 Apr 2009 11:02:55 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: effienct way to select random value from the hash
Message-Id: <49eb665c$0$4892$ed362ca5@nr5-q3a.newsreader.com>

Eric Pozharski wrote:
> On 2009-04-18, Jürgen Exner <jurgenex@hotmail.com> wrote:
>> Eric Pozharski <whynot@pozharski.name> wrote:
> *SKIP*
>>> And one more point of concern: serializing hash into array is a subject
>>> of Perl's own key reordering.  Maybe just do it once?
>> Hmmm, when would perl reorder the keys? I would assume only when the
>> hash itself changes, i.e. when elements are added/removed. And in that
>> case probably you want to restart the random sequence anyway.
> 
> My point was, that when picking random item of already randomized
> sequence, the picked item becomes more or less random?  I don't know.

The order in a hash is not random, it is arbitrary.  (In some 
implementations of perl, in some situations, at some times, it may be 
close to randomized.)


Xho


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

Date: Sun, 19 Apr 2009 10:29:15 +0100
From: Dave Stratford <daves@orpheusmail.co.uk>
Subject: Re: I'm looking for a Perl Book... I think.
Message-Id: <504e5ebdf9daves@orpheusmail.co.uk>

In article
<f3f13985-7e3d-4992-a69e-73759bc9aaf7@k8g2000yqn.googlegroups.com>,
   ccc31807 <cartercc@gmail.com> wrote:
> On Apr 17, 7:22 pm, "Guy" <some...@somewhere.nb.ca> wrote:
> > Ok, I'm creating my own website on genealogy.

> Guy, THE BOOK you need is Paul Dubois, MySQL and Perl for the web.

> It's rather old, but not really out of date, and does more than any
> book I know of to walk you through what you need to do.

> Two cautions: (1) It assumes familiarity with system administration,
> server administration, Perl, and SQL. If you are a beginner at any of
> these, you need to remediate yourself before reading the book. (2) It
> uses both CGI to output HTML and references extensively, so you need
> to bone up on CGI and references. I personally don't use CGI to
> generate HTML so that doesn't bother me, but I had to really get
> familiar with Perl references before the book began to make sense.

I'll have to admit that I totally agree with this. Even after four years
of occasional perl programming, I still find I have to refer to this book
occasionally.

As far as the CGI side goes, I can't recommend highly enough the
HTML::Template module. You write your page as pure HTML, it's better if it
validates correctly first, and then add in a few special tags that
HTML::Template uses eg <TMPL_LOOP> or <TMPL_VAR> and all you need to do is
populate those.

Dave

-- 
Dave Stratford    ZFCA
http://daves.orpheusweb.co.uk/
Hexagon Systems Limited - Experts in VME systems development



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

Date: Sun, 19 Apr 2009 04:42:27 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Apr 19 2009
Message-Id: <KIBzqr.16v7@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-CPANAuthors-Acme-CPANAuthors-Authors-0.1240065387
http://search.cpan.org/~sanko/Acme-CPANAuthors-Acme-CPANAuthors-Authors-0.1240065387/
We are CPAN authors who have authored Acme::CPANAuthors modules 
----
Acme-CPANAuthors-Turkish-0.10
http://search.cpan.org/~burak/Acme-CPANAuthors-Turkish-0.10/
We are Turkish CPAN authors 
----
Acme-CPANAuthors-Turkish-0.11
http://search.cpan.org/~burak/Acme-CPANAuthors-Turkish-0.11/
We are Turkish CPAN authors 
----
Acme-CPANAuthors-Turkish-0.12
http://search.cpan.org/~burak/Acme-CPANAuthors-Turkish-0.12/
We are Turkish CPAN authors 
----
Alien-WiX-0.305217
http://search.cpan.org/~csjewell/Alien-WiX-0.305217/
Installing and finding Windows Installer XML (WiX) 
----
Apache-Session-LDAP-0.01
http://search.cpan.org/~guimard/Apache-Session-LDAP-0.01/
An implementation of Apache::Session 
----
Audio-Scan-0.08
http://search.cpan.org/~agrundma/Audio-Scan-0.08/
Fast C parser for MP3, Ogg Vorbis, FLAC, ASF 
----
Bio-Tools-CodonOptTable-0.07
http://search.cpan.org/~shardiwal/Bio-Tools-CodonOptTable-0.07/
A more elaborative way to check the codons usage. 
----
CGI-Auth-Basic-1.20
http://search.cpan.org/~burak/CGI-Auth-Basic-1.20/
Basic CGI authentication interface. 
----
CGI-Mungo-1.3
http://search.cpan.org/~dumb/CGI-Mungo-1.3/
Very simple CGI web framework 
----
CGI-Mungo-1.3.0
http://search.cpan.org/~dumb/CGI-Mungo-1.3.0/
Very simple CGI web framework 
----
CPAN-Packager-0.041
http://search.cpan.org/~kitano/CPAN-Packager-0.041/
Create packages(rpm, deb) from perl modules 
----
Cache-Memcached-Tie-0.04
http://search.cpan.org/~gugu/Cache-Memcached-Tie-0.04/
Use Cache::Memcached::Fast like hash. 
----
Cache-Memcached-Tie-0.05
http://search.cpan.org/~gugu/Cache-Memcached-Tie-0.05/
Use Cache::Memcached::Fast like hash. 
----
Catalyst-Plugin-Cache-FastMmap-0.8
http://search.cpan.org/~mramberg/Catalyst-Plugin-Cache-FastMmap-0.8/
Mmap cache 
----
Catalyst-Plugin-ConfigLoader-0.23
http://search.cpan.org/~mramberg/Catalyst-Plugin-ConfigLoader-0.23/
Load config files of various types 
----
Catalyst-Plugin-I18N-0.09
http://search.cpan.org/~mramberg/Catalyst-Plugin-I18N-0.09/
I18N for Catalyst 
----
Catalyst-Plugin-Session-Store-File-0.15
http://search.cpan.org/~mramberg/Catalyst-Plugin-Session-Store-File-0.15/
File storage backend for session data. 
----
Catalyst-Plugin-Setenv-0.03
http://search.cpan.org/~mramberg/Catalyst-Plugin-Setenv-0.03/
Allows you to set up the environment from Catalyst's config file. 
----
Catalyst-Plugin-Unicode-0.9
http://search.cpan.org/~mramberg/Catalyst-Plugin-Unicode-0.9/
Unicode aware Catalyst 
----
Catalyst-Plugin-Unicode-0.91
http://search.cpan.org/~mramberg/Catalyst-Plugin-Unicode-0.91/
Unicode aware Catalyst 
----
Catalyst-Runtime-5.80001
http://search.cpan.org/~flora/Catalyst-Runtime-5.80001/
The Catalyst Framework Runtime 
----
Catalyst-View-JSON-0.25
http://search.cpan.org/~miyagawa/Catalyst-View-JSON-0.25/
JSON view for your data 
----
Class-Field-0.15
http://search.cpan.org/~ingy/Class-Field-0.15/
Class Field Accessor Generator 
----
Convert-Binary-C-0.74
http://search.cpan.org/~mhx/Convert-Binary-C-0.74/
Binary Data Conversion using C Types 
----
DBIx-Class-CompressColumns-0.01000
http://search.cpan.org/~jessestay/DBIx-Class-CompressColumns-0.01000/
Automatic Compression/Decompression of columns 
----
DBIx-Class-Schema-Loader-0.04999_07
http://search.cpan.org/~ilmari/DBIx-Class-Schema-Loader-0.04999_07/
Dynamic definition of a DBIx::Class::Schema 
----
DOCSIS-ConfigFile-0.5503
http://search.cpan.org/~jhthorsen/DOCSIS-ConfigFile-0.5503/
Decodes and encodes DOCSIS config-files 
----
Data-UUID-1.201
http://search.cpan.org/~rjbs/Data-UUID-1.201/
Perl extension for generating Globally/Universally Unique Identifiers (GUIDs/UUIDs). 
----
Devel-Declare-0.005000
http://search.cpan.org/~flora/Devel-Declare-0.005000/
Adding keywords to perl, in perl 
----
Dist-Zilla-1.006
http://search.cpan.org/~rjbs/Dist-Zilla-1.006/
distribution builder; installer not included! 
----
Fey-0.27
http://search.cpan.org/~drolsky/Fey-0.27/
Better SQL Generation Through Perl 
----
GD-SecurityImage-1.67
http://search.cpan.org/~burak/GD-SecurityImage-1.67/
Security image (captcha) generator. 
----
GD-Thumbnail-1.32
http://search.cpan.org/~burak/GD-Thumbnail-1.32/
Thumbnail maker for GD 
----
Geo-OSM-MapFeatures-0.03
http://search.cpan.org/~bobkare/Geo-OSM-MapFeatures-0.03/
Parses and represents OpenStreetMap Map Features 
----
Lingua-Any-Numbers-0.26
http://search.cpan.org/~burak/Lingua-Any-Numbers-0.26/
Converts numbers into (any available language) string. 
----
Lingua-TR-Numbers-0.22
http://search.cpan.org/~burak/Lingua-TR-Numbers-0.22/
Converts numbers into Turkish text. 
----
MP3-M3U-Parser-2.22
http://search.cpan.org/~burak/MP3-M3U-Parser-2.22/
MP3 playlist parser. 
----
Module-Changes-ADAMK-0.11
http://search.cpan.org/~adamk/Module-Changes-ADAMK-0.11/
Parse a traditional Changes file (as ADAMK interpretes it) 
----
MojoX-Routes-AsGraph-0.01
http://search.cpan.org/~melo/MojoX-Routes-AsGraph-0.01/
Create a graph from a MojoX::Routes object 
----
MooseX-Accessors-ReadWritePrivate-v1.0.0
http://search.cpan.org/~elliotjs/MooseX-Accessors-ReadWritePrivate-v1.0.0/
Name your accessors get_foo() and set_foo() or _set_foo(). 
----
Net-GitHub-0.06
http://search.cpan.org/~fayland/Net-GitHub-0.06/
Perl Interface for github.com 
----
Net-GitHub-0.06_01
http://search.cpan.org/~fayland/Net-GitHub-0.06_01/
Perl Interface for github.com 
----
Net-GitHub-0.06_02
http://search.cpan.org/~fayland/Net-GitHub-0.06_02/
Perl Interface for github.com 
----
Net-ParSCP-0.10
http://search.cpan.org/~casiano/Net-ParSCP-0.10/
Parallel secure copy 
----
PHP-Session-DBI-0.21
http://search.cpan.org/~burak/PHP-Session-DBI-0.21/
Interface to PHP DataBase Sessions 
----
POE-Filter-DHCPd-Lease-0.02
http://search.cpan.org/~jhthorsen/POE-Filter-DHCPd-Lease-0.02/
parses leases from isc dhcpd leases file 
----
POE-Filter-XML-0.37
http://search.cpan.org/~nperez/POE-Filter-XML-0.37/
A POE Filter for parsing XML 
----
POE-Filter-XML-RPC-0.03
http://search.cpan.org/~nperez/POE-Filter-XML-RPC-0.03/
A POE Filter for marshalling XML-RPC 
----
Perl-Dist-WiX-0.171
http://search.cpan.org/~csjewell/Perl-Dist-WiX-0.171/
Experimental 4th generation Win32 Perl distribution builder 
----
Pod-Coverage-TrustPod-0.002
http://search.cpan.org/~rjbs/Pod-Coverage-TrustPod-0.002/
allow POD to contain Pod::Coverage hints 
----
SVG-Sparkline-0.2.5
http://search.cpan.org/~gwadej/SVG-Sparkline-0.2.5/
Create Sparklines in SVG 
----
Shipwright-2.1.7
http://search.cpan.org/~sunnavy/Shipwright-2.1.7/
Best Practical Builder 
----
Shipwright-2.1.8
http://search.cpan.org/~sunnavy/Shipwright-2.1.8/
Best Practical Builder 
----
Socket-Class-2.12
http://search.cpan.org/~chrmue/Socket-Class-2.12/
A class to communicate with sockets 
----
Socket-Class-2.13
http://search.cpan.org/~chrmue/Socket-Class-2.13/
A class to communicate with sockets 
----
Task-Lingua-Any-Numbers-0.12
http://search.cpan.org/~burak/Task-Lingua-Any-Numbers-0.12/
Installs all number to word modules. 
----
Test-Inline-2.209
http://search.cpan.org/~adamk/Test-Inline-2.209/
Embed your tests in your code, next to what is being tested 
----
Test-MinimumVersion-0.009
http://search.cpan.org/~rjbs/Test-MinimumVersion-0.009/
does your code require newer perl than you think? 
----
Test-Sys-Info-0.14
http://search.cpan.org/~burak/Test-Sys-Info-0.14/
Centralized test suite for Sys::Info. 
----
Time-Elapsed-0.25
http://search.cpan.org/~burak/Time-Elapsed-0.25/
Displays the elapsed time as a human readable string. 
----
Unicode-LineBreak-0.01_01
http://search.cpan.org/~nezumi/Unicode-LineBreak-0.01_01/
UAX #14 Unicode Line Breaking Algorithm 
----
Universe-Galaxy-0.02
http://search.cpan.org/~jkutej/Universe-Galaxy-0.02/
the missing piece in CPAN 
----
Vroom-0.14
http://search.cpan.org/~ingy/Vroom-0.14/
See Vroom::Vroom. 
----
Vroom-0.15
http://search.cpan.org/~ingy/Vroom-0.15/
See Vroom::Vroom. 
----
WWW-Mechanize-FormFiller-0.09
http://search.cpan.org/~corion/WWW-Mechanize-FormFiller-0.09/
framework to automate HTML forms 
----
Win32-ASP-CGI-0.13
http://search.cpan.org/~burak/Win32-ASP-CGI-0.13/
A module for Classic ASP (PerlScript) Programming 
----
Workflow-1.33_3
http://search.cpan.org/~jonasbn/Workflow-1.33_3/
Simple, flexible system to implement workflows 
----
XML-Writer-Simple-0.05
http://search.cpan.org/~ambs/XML-Writer-Simple-0.05/
Create XML files easily! 
----
namespace-autoclean-0.02
http://search.cpan.org/~flora/namespace-autoclean-0.02/
Keep imports out of your namespace 
----
namespace-autoclean-0.03
http://search.cpan.org/~sadrak/namespace-autoclean-0.03/
Keep imports out of your namespace 
----
text_hunspell_1.3
http://search.cpan.org/~eleonora/text_hunspell_1.3/


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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Sun, 19 Apr 2009 11:36:35 -0700 (PDT)
From: Yong Huang <yong321@yahoo.com>
Subject: Print strings based on regular expression
Message-Id: <ba789829-be96-427d-b849-6622616e31ca@s16g2000vbp.googlegroups.com>

Is there a program that prints all possible strings based on a regular
expression?

$ thisprogram '^\w\d$'
A0
A1
 ...
z9

The output could easily be made infinite. That's fine. The point is to
let users visualize what the matching strings look like. I think this
program has great educational value in teaching regular expressions.

Yong Huang


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

Date: Sat, 18 Apr 2009 21:41:45 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: What does `my' do?!
Message-Id: <49eaabe3$0$4890$ed362ca5@nr5-q3a.newsreader.com>

Ilya Zakharevich wrote:
> On 2009-04-19, Ben Morrow <ben@morrow.me.uk> wrote:
>> The question of memory usage is important in some cases, but not really
>> relevant to the semantics.
> 
> To the contrary.  If you ignore the memory usage and speed, there is
> absolutely no point in having closures (for languages with eval()).
> But you already noticed this...

It seems to me that there are plenty of reasons, other than memory usage 
and speed, to avoid string evals.  And other languages that have 
something like eval() might do it in ways such that it can't be used to 
  replace anonymous subroutine closures.  For that matter, I think Perl 
would be entitled to change eval in ways that break this.  The eval docs 
say that subroutine defined inside eval are visible after the eval, but 
doesn't say what the behavior of outer scoped lexical variable would be 
in that case.

My point was to explore the essence of what a closure is, not to propose 
practical alternatives to anonymous subrefs.

Xho


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

Date: Sat, 18 Apr 2009 21:28:03 -0700 (PDT)
From: kun niu <haoniukun@gmail.com>
Subject: Re: What's wrong with the following regular expression?
Message-Id: <638cbbc4-d991-41b2-bf9e-9e3036155be7@d2g2000pra.googlegroups.com>

On 4=D4=C219=C8=D5, =C9=CF=CE=E710=CA=B107=B7=D6, Tad J McClellan <ta...@se=
esig.invalid> wrote:
> kun niu <haoniu...@gmail.com> wrote:
> > On 4??19??, ????4??09??, Tad J McClellan <ta...@seesig.invalid> wrote:
> >> kun niu <haoniu...@gmail.com> wrote:
> >> > $content =3D "<a href=3D\"mailto:t...@google.com\"><a class=3D\"hell=
o\" href=3D
>
>                                                   ^^
>                                                   ^^
>
> The data has a quote followed by an angle bracket.
>
> >> > \"mailto:t...@google.com?title=3Dhello\">";
>
> >> You should always enable warnings when developing Perl code.
>
> >> > @emails =3D ($content =3D~ /<a.*href=3D"mailto:(.*)>"/cgim);
>
> >>                                                ^^
> >>                                                ^^ these are transposed=
 ...
>
> The word "transposed" means "order is reversed"...
>
> >> --
> >> Tad McClellan
> >> email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
>
> It is bad manners to quote .sigs.
>
> > But I wonder how @emails =3D ($content =3D~ /<a.*href=3D"mailto:(.*)>"/
>
>                                                                 ^^
>                                                                 ^^
>
> The pattern has an angle bracket followed by a quote.
>
> > I turned on warnings with "perl -w" and I don't see a warning here.
>
> The warning (Possible unintended interpolation) was from the
> assignment line, not the pattern line.
>
> --
> Tad McClellan
> email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"

I got it.:)
Sorry for my carelessness.
And really appreciate your reply.


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

Date: Sun, 19 Apr 2009 07:08:32 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: What's wrong with the following regular expression?
Message-Id: <slrngum520.hei.tadmc@tadmc30.sbcglobal.net>

kun niu <haoniukun@gmail.com> wrote:
> On 4??19??, ????10??07??, Tad J McClellan <ta...@seesig.invalid> wrote:
>> kun niu <haoniu...@gmail.com> wrote:
>> > On 4??19??, ????4??09??, Tad J McClellan <ta...@seesig.invalid> wrote:


>> >> --
>> >> Tad McClellan
>> >> email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
>>
>> It is bad manners to quote .sigs.


>> --
>> Tad McClellan
>> email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


OK. That's enough.

Off to the killfile with you.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Sun, 19 Apr 2009 12:24:56 -0700
From: sln@netherlands.com
Subject: Re: What's wrong with the following regular expression?
Message-Id: <sbtmu419058glrp8u1nc5fubru57mvu3ka@4ax.com>

On Sat, 18 Apr 2009 09:01:57 -0700 (PDT), kun niu <haoniukun@gmail.com> wrote:

>Dear all,
>
>I'm trying to help to extrace email from company's website.
>Here's part of my test script.
>
>$content = "<a href=\"mailto:test@google.com\"><a class=\"hello\" href=
>\"mailto:test@google.com?title=hello\">";
>@emails = ($content =~ /<a.*href="mailto:(.*)>"/cgim);
>foreach my $email (@emails)
>{
>    print "email:" .  $email . "\n";
>}
>But to my surprise, no result is printed.
>I'm working on Debian squeeze.
>My perl version is 5.10.0.
>Would anyone here please help me out?
>Thanks for any hints or advice in advance.

Below are better html/xml regular expressions to parse <tag attrib/>,
what your interrested in. And it will get all the 'mailto:'s.
Might as well do it right.
Test sample html and output below __DATA__ section

-sln

## Arxp.pl
## 
## Simple html/xml regexp parser for just <tag attrib/>
## No entity conversions, no extras. 
## Let me know if you want conversions or simple extra's
## -sln 4/19/09
##

my @UC_Nstart = (
    "\\x{C0}-\\x{D6}",
    "\\x{D8}-\\x{F6}",
    "\\x{F8}-\\x{2FF}",
    "\\x{370}-\\x{37D}",
    "\\x{37F}-\\x{1FFF}",
    "\\x{200C}-\\x{200D}",
    "\\x{2070}-\\x{218F}",
    "\\x{2C00}-\\x{2FEF}",
    "\\x{3001}-\\x{D7FF}",
    "\\x{F900}-\\x{FDCF}",
    "\\x{FDF0}-\\x{FFFD}",
    "\\x{10000}-\\x{EFFFF}",
  ); 
my @UC_Nchar = (
    "\\x{B7}",
    "\\x{0300}-\\x{036F}",
    "\\x{203F}-\\x{2040}",
  );
my $Nstrt = "[A-Za-z_:".join ('',@UC_Nstart)."]";
my $Nchar = "[-\\w:\\.".join ('',@UC_Nchar).join ('',@UC_Nstart)."]";
my $Name  = "(?:$Nstrt$Nchar*)";

my $qRx = qr/<(?:(?:($Name)(\s+(?:(?:(?:".*?")|(?:'.*?'))|(?:[^>]*?))+)\s*\/?)|--.*?--)>/s;
#            <(  (  1     12   (  (  (       )|(       ))|(        )) 2      )|       )> 

my $qRxAttr = qr/\G\s+(?:(?:($Name)\s*=\s*("|'|))|($Name))/;
my $qRxAttr_DL1 = qr/\G(?:([^'&<]*?)|([^'<]*?))'/;
my $qRxAttr_DL2 = qr/\G(?:([^"&<]*?)|([^"<]*?))"/;
my $qRxAttr_DL3 = qr/\G([^"'=<\s]+)/;


my $html = join '', <DATA>;

while ($html =~ /$qRx/g)
{
	## <tag attrib/> or <tag attrib>
	## 
	if (defined $1) 	# && lc($1) eq 'a'
	{
		my %result = ();
		# get attributes
		$result = _getAttrARRAY ($2, 0, \%result);

		## do checks
		if (length ($result->{'errstr'})) {
			# missing or extra token, hard error
			print  "Error in tag attrib string here ->'$result->{'errstr'}'\n";
			next;
		}
		## we will consider these acceptable html, not processed for this
		# length ($result->{'dupattrs'})
		# length ($result->{'badattrs'})
		# length ($result->{'noquoteattrs'})

		## process (scrape) attribute array for 'mailto:'
		my %htmp = @{$result->{'attrsref'}};

		while (my ($atr,$val) = each %htmp)
		{
			push @emails, $1 if ($val =~ /mailto:(.+)/is);
		}
	}
}
print $_,"\n" for @emails;

# -------------------------------

sub _convertEntities { undef } # intentionally blank

sub _getAttrARRAY
{
	my ($attrstr, $conv_ent, $hresult) = @_;
	@{$hresult->{'attrsref'}} = ();
	$hresult->{'badattrs'} = '';
	$hresult->{'dupattrs'} = '';
	$hresult->{'noquoteattrs'} = '';
	$hresult->{'errstr'} = '';
	my %hseen = ();
	my $aref = $hresult->{'attrsref'};
	my ($alt_attval, $attval, $rx, $ndx, $DL3);
	# my $tmpstr = $attrstr;
	my $match = 0;

	while ($attrstr =~ /$qRxAttr/gc)
	{
		$match = 1;
		if (defined $2)
		{
			$ndx = push @{$aref},$1;
			$DL3 = 0;

			if ($2 eq "'") {
				$rx = \$qRxAttr_DL1;
			}
			elsif ($2 eq '"') {
				$rx = \$qRxAttr_DL2;
			} else {
				# no quotes
				$rx = \$qRxAttr_DL3;
				$DL3 = 1;
			}
			if (++$hseen{$1} == 2) {
				$hresult->{'dupattrs'} .= ", $1";
				$hresult->{'dupattrs'} =~ s/^(?:, )+//;
			}
			if ($attrstr =~ /$$rx/gc) {
				if (!$DL3)
				 {
					## normal quoted value
					if (defined $1) {
						push @{$aref},$1;
						next;
					}
					$attval = $2;
					if ($conv_ent && defined ($alt_attval = _convertEntities (\$attval))) {
						push @{$aref},$$alt_attval;
						next;
					}
					push @{$aref},$attval;
					next;
				}
				## bad attrib, value is not quoted
				$attval = $1;
				if ($conv_ent && defined ($alt_attval = _convertEntities (\$attval))) {
					push @{$aref},$$alt_attval;
				} else {
					push @{$aref},$attval;
				}
				$hresult->{'noquoteattrs'} .= ", ".$aref->[$ndx-1];
				$hresult->{'noquoteattrs'} =~ s/^(?:, )+//;
				next;
			}
			## bad value, its either '<' or no ["'] closure
			$hresult->{'badattrs'} .= ", ".$aref->[$ndx-1];
			$hresult->{'badattrs'} =~ s/^(?:, )+//;
			push @{$aref},'UNDEF_ATTRVAL';
			# trim up to '<', otherwise its reported as
			# improperly quoted or missing value
			$attrstr = substr ($attrstr, pos($attrstr));
			$attrstr =~ s/^[^<]+//;
		} else {
			## attrib with no attrib value
			## (standalone atrribute only)
			$ndx = push @{$aref},$3;
			if (++$hseen{$3} == 2) {
				$hresult->{'dupattrs'} .= ", $3";
				$hresult->{'dupattrs'} =~ s/^(?:, )+//;
			}
			$hresult->{'badattrs'} .= ", ".$aref->[$ndx-1];
			$hresult->{'badattrs'} =~ s/^(?:, )+//;
			push @{$aref},'UNDEF_ATTRVAL';
			next;
		}
		# bad, return that part of string which is in error
		$hresult->{'errstr'} = $attrstr;
		return $hresult;
	}
	pos($attrstr) = 0 if (!$match);
	if (length($attrstr) > pos($attrstr)) {
		$attrstr = substr ($attrstr, pos($attrstr));
		$attrstr =~ s/^\s+//; $attrstr =~ s/\s+$//;
		# bad, return that part of string which is in error
		# print "-BAD-:$tmpstr\n";
		$hresult->{'errstr'} = $attrstr if (length($attrstr));
	}
	return $hresult;
}

__DATA__

<-- Don't include <a href='mailto:test@Woogle.com'> me -->
<a href='mailto:test@google.com'>
<a class="hello" href=
"mailto:test@google.com?title='&lt;hello&gt';">
<tag scrape_me = "mailto:why@google.com"
/>
<oh nogood = "mailto:somebody@yahoo.com' >


Output:
 test@google.com
 test@google.com?title='&lt;hello&gt';
 why@google.com



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

Date: Sun, 19 Apr 2009 12:50:13 -0700
From: sln@netherlands.com
Subject: Re: What's wrong with the following regular expression?
Message-Id: <bnvmu4hj4mjmucvp8koms16r629ci4f2kr@4ax.com>

On Sun, 19 Apr 2009 12:24:56 -0700, sln@netherlands.com wrote:

>On Sat, 18 Apr 2009 09:01:57 -0700 (PDT), kun niu <haoniukun@gmail.com> wrote:
>
>Below are better html/xml regular expressions to parse <tag attrib/>,
>what your interrested in. And it will get all the 'mailto:'s.
>Might as well do it right.
>Test sample html and output below __DATA__ section
>
>

Sorry bout that. Left out a couple of things in the chop.
-sln

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

>## Arxp.pl
>## 
>## Simple html/xml regexp parser for just <tag attrib/>
[snip]

use strict;
use warnings;

[snip]

>my @UC_Nstart = (

[snip]

>while ($html =~ /$qRx/g)
>{
>	## <tag attrib/> or <tag attrib>
>	## 
>	if (defined $1) 	# && lc($1) eq 'a'
>	{
>		my %result = ();
>		# get attributes
		_getAttrARRAY ($2, 0, \%result);
>
>		## do checks
		if (length ($result{'errstr'})) {
>			# missing or extra token, hard error
			print  "Error in tag attrib string here ->'$result{'errstr'}'\n";
>			next;
>		}
>		## we will consider these acceptable html, not processed for this
		# length ($result{'dupattrs'})
		# length ($result{'badattrs'})
		# length ($result{'noquoteattrs'})
>
>		## process (scrape) attribute array for 'mailto:'
		my %htmp = @{$result{'attrsref'}};
>
>		while (my ($atr,$val) = each %htmp)
>		{
>			push @emails, $1 if ($val =~ /mailto:(.+)/is);
>		}
>	}
>}
[snip]




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

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


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