[29410] in Perl-Users-Digest
Perl-Users Digest, Issue: 654 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 16 16:10:09 2007
Date: Mon, 16 Jul 2007 13:09:10 -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 Mon, 16 Jul 2007 Volume: 11 Number: 654
Today's topics:
Array <vedpsingh@gmail.com>
Re: Array <scobloke2@infotop.co.uk>
Re: Array (Jens Thoms Toerring)
Re: Array <rvtol+news@isolution.nl>
Re: Array <glennj@ncf.ca>
Re: Array <wahab@chemie.uni-halle.de>
Re: FAQ 4.30 How do I capitalize all the words on one l <bik.mido@tiscalinet.it>
Re: FAQ 5.6 How do I make a temporary file name? anno4000@radom.zrz.tu-berlin.de
Re: FAQ 5.6 How do I make a temporary file name? <savagebeaste@yahoo.com>
Handling Large files (a few Gb) in Perl <sydches@gmail.com>
Re: Handling Large files (a few Gb) in Perl <mritty@gmail.com>
Re: Handling Large files (a few Gb) in Perl <sydches@gmail.com>
Re: Handling Large files (a few Gb) in Perl <glex_no-spam@qwest-spam-no.invalid>
Re: Handling Large files (a few Gb) in Perl xhoster@gmail.com
Re: Handling Large files (a few Gb) in Perl <hjp-usenet2@hjp.at>
Re: How to unambiguously escape non-printables in filen <john.stumbles@ntlworld.com>
new CPAN modules on Mon Jul 16 2007 (Randal Schwartz)
Re: searching for a special string in an array <glennj@ncf.ca>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 16 Jul 2007 14:36:44 -0000
From: Ved <vedpsingh@gmail.com>
Subject: Array
Message-Id: <1184596604.268665.93140@o11g2000prd.googlegroups.com>
Hi All,
I am simply printing as shown in program below.
number of elements in @signal keeps on changing. So how do I maintain
same length in the print statement below.
As of now I keep changing manually.
#!/usr/local/bin/perl
use strict;
use warnings;
my @signal = qw{ mode_20mhz #This keeps on changing
indexEn
txctrl_ltf_fld_index
rotate90
pilot_position
null_position
doneFlag
ltf_sel
};
foreach my $sig (@signal) {
# print "
@signal[0],@signal[1],@signal[2],@signal[3],@signal[4],@signal[5],@signal
[6],@signal[7],@signal[8],@signal[9]; \n";
print "
@signal[0],@signal[1],@signal[2],@signal[3],@signal[4],@signal[5],@signal[6];
\n";
#How do I manage this length of array ?
------------------------------
Date: Mon, 16 Jul 2007 16:27:49 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Array
Message-Id: <469b8e7a$0$31722$db0fefd9@news.zen.co.uk>
Ved wrote:
> Hi All,
> I am simply printing as shown in program below.
>
> number of elements in @signal keeps on changing. So how do I maintain
> same length in the print statement below.
> As of now I keep changing manually.
>
> #!/usr/local/bin/perl
> use strict;
> use warnings;
>
> my @signal = qw{ mode_20mhz #This keeps on changing
and you can't insert #comments into a qw{} construct.
> indexEn
> txctrl_ltf_fld_index
> rotate90
> pilot_position
> null_position
> doneFlag
> ltf_sel
> };
>
> foreach my $sig (@signal) {
> # print "
> @signal[0],@signal[1],@signal[2],@signal[3],@signal[4],@signal[5],@signal
> [6],@signal[7],@signal[8],@signal[9]; \n";
>
> print "
> @signal[0],@signal[1],@signal[2],@signal[3],@signal[4],@signal[5],@signal[6];
> \n";
Use a $ not an @ when referencing a scalar element of an array.
print "$signal[0]";
> #How do I manage this length of array ?
>
You can interpolate all the array's values into a string.
print "@signal\n";
------------------------------
Date: 16 Jul 2007 17:11:06 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: Array
Message-Id: <5g1n5aF3dl46cU1@mid.uni-berlin.de>
Ian Wilson <scobloke2@infotop.co.uk> wrote:
> Ved wrote:
> > I am simply printing as shown in program below.
> >
> > number of elements in @signal keeps on changing. So how do I maintain
> > same length in the print statement below.
> > As of now I keep changing manually.
> >
> > #!/usr/local/bin/perl
> > use strict;
> > use warnings;
> >
> > my @signal = qw{ mode_20mhz #This keeps on changing
> and you can't insert #comments into a qw{} construct.
> > indexEn
> > txctrl_ltf_fld_index
> > rotate90
> > pilot_position
> > null_position
> > doneFlag
> > ltf_sel
> > };
> >
> > foreach my $sig (@signal) {
> > # print "
> > @signal[0],@signal[1],@signal[2],@signal[3],@signal[4],@signal[5],@signal
> > [6],@signal[7],@signal[8],@signal[9]; \n";
> >
> > print "
> > @signal[0],@signal[1],@signal[2],@signal[3],@signal[4],@signal[5],@signal[6];
> > \n";
> Use a $ not an @ when referencing a scalar element of an array.
> print "$signal[0]";
> > #How do I manage this length of array ?
> You can interpolate all the array's values into a string.
> print "@signal\n";
Since Ved seems to want to have commas between the array elements
perhaps
print join( ',', @signal ) . "\n";
would be more to his liking.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
------------------------------
Date: Mon, 16 Jul 2007 19:53:36 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Array
Message-Id: <f7gihf.14c.1@news.isolution.nl>
Jens Thoms Toerring schreef:
> print join( ',', @signal ) . "\n";
There will not be a "\n" at the end.
Alternative-1:
{ local $, = "\n";
print @signal, $,;
}
which has the advantage of not creating a buffer with copies first.
Alternative-2:
print "$_\n" for @signal;
which has the disadvantage of doing multiple prints.
Alternative-3:
print map "$_\n", @signal;
which creates copies, as #2 does, but does a single print.
I prefer #1 especially when the array can be "big" (both in number of
elements as in size per element).
The join-variant is to me the least appealing one.
I suppose that the map-variant makes use of the lazy behaviour of map,
so "underneath" it acts much like the for-variant (it doesn't need to
create a full array first before starting to print).
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 16 Jul 2007 18:29:44 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: Array
Message-Id: <slrnf9ne8p.6km.glennj@smeagol.ncf.ca>
At 2007-07-16 01:11PM, "Jens Thoms Toerring" wrote:
> Ian Wilson <scobloke2@infotop.co.uk> wrote:
> > You can interpolate all the array's values into a string.
>
> > print "@signal\n";
>
> Since Ved seems to want to have commas between the array elements
> perhaps
>
> print join( ',', @signal ) . "\n";
>
> would be more to his liking.
or
{ local ($,,$\)=(',',$/); print @signal }
--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
------------------------------
Date: Mon, 16 Jul 2007 20:48:03 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Array
Message-Id: <f7geh6$c30$1@nserver.hrz.tu-freiberg.de>
Glenn Jackman wrote:
> At 2007-07-16 01:11PM, "Jens Thoms Toerring" wrote:
>> Ian Wilson <scobloke2@infotop.co.uk> wrote:
>>> You can interpolate all the array's values into a string.
>>
>>> print "@signal\n";
>>
>> Since Ved seems to want to have commas between the array elements
>> perhaps
>>
>> print join( ',', @signal ) . "\n";
>>
>> would be more to his liking.
>
> or
> { local ($,,$\)=(',',$/); print @signal }
or
use Perl6::Say;
my @signal = qw # This keeps on changing
' mode_20mhz indexEn txctrl_ltf_fld_indexrotate90
pilot_position null_position doneFlag ltf_sel ';
say() for @signal;
Regards
M.
------------------------------
Date: Mon, 16 Jul 2007 21:11:55 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FAQ 4.30 How do I capitalize all the words on one line?
Message-Id: <9jem93lo9ous74bqvvjeqtum18ltbdsmb0@4ax.com>
On Sat, 14 Jul 2007 12:52:50 +0200, "Dr.Ruud"
<rvtol+news@isolution.nl> wrote:
>If =~ would bind to a list, you could write:
>
> $string =~ s/ ^ ( [[:alpha:]] ) /\U$1/x,
> s/ ( \s [[:alpha:]] ) /\U$1/xg,
> ;
Funny, I've always seen the rfc the other way round, with a list on
the lhs. I wonder how ~~ is supposed to behave in this respect, and I
can't remember. Time to go and read some exegesis...
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: 16 Jul 2007 08:19:07 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: FAQ 5.6 How do I make a temporary file name?
Message-Id: <5g0nvrF3eahuuU1@mid.dfncis.de>
Clenna Lumina <savagebeaste@yahoo.com> wrote in comp.lang.perl.misc:
> PerlFAQ Server wrote:
> [...]
> > BEGIN {
> > use Fcntl;
> > my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMPDIR} ||
> > $ENV{TEMP}; my $base_name = sprintf("%s/%d-%d-0000",
> > $temp_dir, $$, time());
> >
> > sub temp_file {
> > local *FH;
> > my $count = 0;
> > until (defined(fileno(FH)) || $count++ > 100) {
> > $base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
> > # O_EXCL is required for security reasons.
> > sysopen(FH, $base_name, O_WRONLY|O_EXCL|O_CREAT);
> > }
> >
> > if (defined(fileno(FH))
> ^^^
>
> > return (*FH, $base_name);
> > }
> > else {
> > return ();
> > }
> > }
> > }
>
> Not sure if this has been pointed out before, but there is no opening
> { after C< if (defined(fileno(FH)) >
There's another paren missing, and the indentation is messy. Here is a
corrected version:
BEGIN {
use Fcntl;
my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMPDIR} || $ENV{TEMP};
my $base_name = sprintf("%s/%d-%d-0000", $temp_dir, $$, time());
sub temp_file {
local *FH;
my $count = 0;
until (defined(fileno(FH)) || $count++ > 100) {
$base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
# O_EXCL is required for security reasons.
sysopen(FH, $base_name, O_WRONLY|O_EXCL|O_CREAT);
}
if (defined(fileno(FH))) {
return (*FH, $base_name);
}
else {
return ();
}
}
}
Anno
------------------------------
Date: Mon, 16 Jul 2007 09:06:03 -0700
From: "Clenna Lumina" <savagebeaste@yahoo.com>
Subject: Re: FAQ 5.6 How do I make a temporary file name?
Message-Id: <5g1j7kF3ed4ljU1@mid.individual.net>
anno4000@radom.zrz.tu-berlin.de wrote:
> Clenna Lumina <savagebeaste@yahoo.com> wrote in comp.lang.perl.misc:
>> PerlFAQ Server wrote:
>> [...]
>>> BEGIN {
>>> use Fcntl;
>>> my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMPDIR} ||
>>> $ENV{TEMP}; my $base_name = sprintf("%s/%d-%d-0000",
>>> $temp_dir, $$, time());
>>>
>>> sub temp_file {
>>> local *FH;
>>> my $count = 0;
>>> until (defined(fileno(FH)) || $count++ > 100) {
>>> $base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
>>> # O_EXCL is required for security reasons.
>>> sysopen(FH, $base_name, O_WRONLY|O_EXCL|O_CREAT);
>>> }
>>>
>>> if (defined(fileno(FH))
>> ^^^
>>
>>> return (*FH, $base_name);
>>> }
>>> else {
>>> return ();
>>> }
>>> }
>>> }
>>
>> Not sure if this has been pointed out before, but there is no opening
>> { after C< if (defined(fileno(FH)) >
>
> There's another paren missing, and the indentation is messy. Here is
> a corrected version:
>
> BEGIN {
> use Fcntl;
> my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMPDIR} || $ENV{TEMP};
> my $base_name = sprintf("%s/%d-%d-0000", $temp_dir, $$,
> time());
>
> sub temp_file {
> local *FH;
> my $count = 0;
> until (defined(fileno(FH)) || $count++ > 100) {
> $base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
> # O_EXCL is required for security reasons.
> sysopen(FH, $base_name, O_WRONLY|O_EXCL|O_CREAT);
> }
>
> if (defined(fileno(FH))) {
> return (*FH, $base_name);
> }
> else {
> return ();
> }
> }
> }
>
> Anno
Much better (on the eyes as well.) :)
--
CL
------------------------------
Date: Mon, 16 Jul 2007 04:40:44 -0700
From: "sydches@gmail.com" <sydches@gmail.com>
Subject: Handling Large files (a few Gb) in Perl
Message-Id: <1184586044.944248.284260@22g2000hsm.googlegroups.com>
Hi,
I am a beginner (or worse) at Perl.
I have a need to find the longest line (record) in a file. The below
code works neatly for small files.
But when I need to read huge files (in the order of Gb), it is very
slow.
I need to write an output file with stuff like:
Longest line is... occurring on line number...
There are ... lines in the file
The same file is crunched using C in about 30 milliseconds!
The difference in run times of Perl/VbScript and C is a significant
one.
Could someone help me in finding what way I could make Perl work the
best way for processing huge files such as these?
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
my $prev=-1;
my $curr=0;
my ($sec,$min,$hour,$com) = localtime(time);
print "Start time - $hour:$min:$sec \n";
open(F1, "c:\\perl\\syd\\del.txt");
while (<F1>)
{
$curr = index($_, "\x0A");
if($curr > $prev)
{
$prev = $curr;
}
}
close(F1);
my ($sec,$min,$hour,$com) = localtime(time);
print "End time - $hour:$min:$sec \n";
print "Lengthiest record length: $prev \n";
The output times for a 1 Gb is
Start time - 20:32:31
End time - 20:34:28
Lengthiest record length: 460
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I am running this on a laptop with Windows XP, 1.7 GHz processor with
1 Gb of RAM
I am using ActivePerl
Thanks in advance!
Syd
------------------------------
Date: Mon, 16 Jul 2007 05:15:31 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Handling Large files (a few Gb) in Perl
Message-Id: <1184588131.975042.169330@n2g2000hse.googlegroups.com>
On Jul 16, 7:40 am, "sydc...@gmail.com" <sydc...@gmail.com> wrote:
> I am a beginner (or worse) at Perl.
>
> I have a need to find the longest line (record) in a file. The below
> code works neatly for small files.
> But when I need to read huge files (in the order of Gb), it is very
> slow.
> Could someone help me in finding what way I could make Perl work the
> best way for processing huge files such as these?
>
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> my $prev=-1;
> my $curr=0;
>
> my ($sec,$min,$hour,$com) = localtime(time);
> print "Start time - $hour:$min:$sec \n";
>
> open(F1, "c:\\perl\\syd\\del.txt");
>
> while (<F1>)
> {
> $curr = index($_, "\x0A");
Well here's one improvement you could make. Don't force Perl to
search through each string looking for a specific character. Just ask
it what the lenght of the string is. In my tests, that's about 10%
faster:
#!/usr/bin/perl
use strict;
use warnings;
use Benchmark qw/:all/;
sub use_index {
open my $fh, '<', 'ipsum.txt' or die $!;
my $prev = 0;
while (<$fh>) {
my $cur = index($_, "\x0A");
if ($cur > $prev) {
$prev = $cur;
}
}
}
sub use_length {
open my $fh, '<', 'ipsum.txt' or die $!;
my $prev = 0;
while (<$fh>) {
my $cur = length;
if ($cur > $prev) {
$prev = $cur;
}
}
}
cmpthese(timethese(100_000, { length => \&use_length, index =>
\&use_index }));
__END__
Benchmark: timing 100000 iterations of index, length...
index: 26 wallclock secs (19.81 usr + 6.27 sys = 26.08 CPU) @
3834.36/s (n=100000)
length: 24 wallclock secs (17.10 usr + 6.47 sys = 23.57 CPU) @
4242.68/s (n=100000)
Rate index length
index 3834/s -- -10%
length 4243/s 11% --
Paul Lalli
------------------------------
Date: Mon, 16 Jul 2007 08:37:13 -0700
From: "sydches@gmail.com" <sydches@gmail.com>
Subject: Re: Handling Large files (a few Gb) in Perl
Message-Id: <1184600233.642382.125730@o61g2000hsh.googlegroups.com>
Hi Paul,
Thank you for your suggestion. This does speed up things quite a bit.
Is there any other way to speed this up much faster? It is still slow
and my pc hangs up on me, for large files.
Warm regards!
Syd
------------------------------
Date: Mon, 16 Jul 2007 11:37:01 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Handling Large files (a few Gb) in Perl
Message-Id: <469b9eae$0$500$815e3792@news.qwest.net>
sydches@gmail.com wrote:
> Hi Paul,
>
> Thank you for your suggestion. This does speed up things quite a bit.
>
> Is there any other way to speed this up much faster?
Write it in C.
>It is still slow
> and my pc hangs up on me, for large files.
It shouldn't 'hang' your PC. It might use a large percentage of
the CPU though.
------------------------------
Date: 16 Jul 2007 17:01:05 GMT
From: xhoster@gmail.com
Subject: Re: Handling Large files (a few Gb) in Perl
Message-Id: <20070716130107.280$XB@newsreader.com>
"sydches@gmail.com" <sydches@gmail.com> wrote:
> Hi,
>
> I am a beginner (or worse) at Perl.
>
> I have a need to find the longest line (record) in a file. The below
> code works neatly for small files.
> But when I need to read huge files (in the order of Gb), it is very
> slow.
>
> I need to write an output file with stuff like:
> Longest line is... occurring on line number...
> There are ... lines in the file
>
> The same file is crunched using C in about 30 milliseconds!
I can't get anywhere near that speed in C. Can you post your C code,
and some Perl code that generates a sample file to be operated on?
> The difference in run times of Perl/VbScript and C is a significant
> one.
>
> Could someone help me in finding what way I could make Perl work the
> best way for processing huge files such as these?
Since you already have a C program which works, use it.
>
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> my $prev=-1;
> my $curr=0;
>
> my ($sec,$min,$hour,$com) = localtime(time);
> print "Start time - $hour:$min:$sec \n";
>
> open(F1, "c:\\perl\\syd\\del.txt");
>
> while (<F1>)
> {
> $curr = index($_, "\x0A");
You are searching for the end of line marker twice, once implicitly in the
readline (<F1>) and once here. And you already know where it will be
found the second time--either at the end, or no where.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Mon, 16 Jul 2007 21:18:54 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Handling Large files (a few Gb) in Perl
Message-Id: <slrnf9nh4u.u5j.hjp-usenet2@zeno.hjp.at>
On 2007-07-16 11:40, sydches@gmail.com <sydches@gmail.com> wrote:
> I have a need to find the longest line (record) in a file. The below
> code works neatly for small files.
> But when I need to read huge files (in the order of Gb), it is very
> slow.
>
> I need to write an output file with stuff like:
> Longest line is... occurring on line number...
> There are ... lines in the file
>
> The same file is crunched using C in about 30 milliseconds!
[...]
> I am running this on a laptop with Windows XP, 1.7 GHz processor with
> 1 Gb of RAM
I don't believe that. Since you have only 1 GB RAM, you can't keep a
1 GB file completely in memory. And you can't read a 1 GB file from disk
in 30 milliseconds - certainly not from a laptop hard disk (30 seconds
sounds more likely). Even if the whole file is cached in RAM I think
that you can't scan 1GB of RAM in 30 ms (The new Power6 CPU claims a
*maximum* memory read bandwidth of 40 GB/s - theoretically enough to
scan 1 GB in 25 ms, but I doubt you get even close to that number in
practice). My best attempt takes about 2 seconds user time (1.85 GHz
Core2). I won't be surprised if somebody can improve this by an order of
magnitude, but anything more requires serious magic.
Just for comparison. Your script takes about 20.5 seconds on my system.
The obvious optimization (using length instead of index) brings it down
to 19.3 seconds. A naive portable C version (using stdio) is about as
fast as your script (21.0 seconds), and a naive C version using mmap
and strtok is much slower (37.4 seconds), but very much reduces CPU
time. I guess by combining low level I/O calls (maybe even async I/O)
and strtok I could get close to 15 seconds, which should be just about
possible with the disk I have.
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: Sun, 15 Jul 2007 23:01:07 GMT
From: John Stumbles <john.stumbles@ntlworld.com>
Subject: Re: How to unambiguously escape non-printables in filenames
Message-Id: <TGxmi.22948$vA3.17573@newsfe2-win.ntli.net>
On Sun, 15 Jul 2007 16:51:56 +0200, Gunnar Hjalmarsson wrote:
> John Stumbles wrote:
>> So URI escape is fooled by an occurrence of an escape sequence in the
>> original string.
>
> That's because you excluded '%' from the set of characters that are to
> be escaped.
D'oh!
> it works just fine.
Yes it seems to. I've tried fooling it by throwing %25 at it in the
original string but it happily escapes the % and then unescapes the
resultant string back to what it should be.
Thank you!
--
John Stumbles
I've got nothing against racists - I just wouldn't want my daughter to marry one
------------------------------
Date: Mon, 16 Jul 2007 04:42:12 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Jul 16 2007
Message-Id: <JL992C.11vn@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.
Alter-0.04
http://search.cpan.org/~anno/Alter-0.04/
Alter Ego Objects
----
Authen-Htpasswd-0.16
http://search.cpan.org/~dkamholz/Authen-Htpasswd-0.16/
interface to read and modify Apache .htpasswd files
----
CDB_Perl-0.05
http://search.cpan.org/~plank/CDB_Perl-0.05/
Perl extension reading and creating CDB files
----
CDB_Perl-0.50
http://search.cpan.org/~plank/CDB_Perl-0.50/
Perl extension reading and creating CDB files
----
CGI-Application-Plugin-ErrorPage-1.12
http://search.cpan.org/~markstos/CGI-Application-Plugin-ErrorPage-1.12/
A simple error page plugin for CGI::Application
----
CGI-Uploader-2.15
http://search.cpan.org/~markstos/CGI-Uploader-2.15/
Manage CGI uploads using SQL database
----
Calendar-0.03
http://search.cpan.org/~yewenbin/Calendar-0.03/
Perl extension for calendar convertion
----
Catalyst-View-Mason-0.09_06
http://search.cpan.org/~flora/Catalyst-View-Mason-0.09_06/
Mason View Class
----
Class-MOP-0.41
http://search.cpan.org/~stevan/Class-MOP-0.41/
A Meta Object Protocol for Perl 5
----
Class-Std-Slots-v0.1
http://search.cpan.org/~andya/Class-Std-Slots-v0.1/
Provide signals and slots for standard classes.
----
HTML-Mail-0.03
http://search.cpan.org/~plank/HTML-Mail-0.03/
Perl extension for sending emails with embedded HTML and media
----
HTML-ReplaceForm-0.51
http://search.cpan.org/~markstos/HTML-ReplaceForm-0.51/
easily replace HTML form fields with corresponding values
----
IO-Async-0.08
http://search.cpan.org/~pevans/IO-Async-0.08/
a collection of modules that implement asynchronous filehandle IO
----
Mail-DWIM-0.01
http://search.cpan.org/~mschilli/Mail-DWIM-0.01/
Do-What-I-Mean Mailer
----
Math-Geometry-Planar-Offset-1.05
http://search.cpan.org/~ewilhelm/Math-Geometry-Planar-Offset-1.05/
Calculate offset polygons
----
Module-MultiConf-0.0100_04
http://search.cpan.org/~oliver/Module-MultiConf-0.0100_04/
Configure and validate your app modules in one go
----
MooseX-Storage-0.05
http://search.cpan.org/~stevan/MooseX-Storage-0.05/
An serialization framework for Moose classes
----
Pod-Manual-0.03
http://search.cpan.org/~yanick/Pod-Manual-0.03/
Aggregates several PODs into a single manual
----
SMS-AQL-0.04
http://search.cpan.org/~bigpresh/SMS-AQL-0.04/
Perl extension to send SMS text messages via AQ's SMS service
----
SQL-Interp-1.01
http://search.cpan.org/~markstos/SQL-Interp-1.01/
Interpolate Perl variables into SQL statements
----
STAFService-0.03
http://search.cpan.org/~semuelf/STAFService-0.03/
Perl extension for writing STAF Services easily.
----
STAFService-0.04
http://search.cpan.org/~semuelf/STAFService-0.04/
Perl extension for writing STAF Services easily.
----
Test-Config-System-0.50
http://search.cpan.org/~iank/Test-Config-System-0.50/
System configuration related unit tests
----
Test-Inline-2.205
http://search.cpan.org/~adamk/Test-Inline-2.205/
Lets you put tests in your modules, next to tested code
----
WWW-Facebook-API-v0.4.2
http://search.cpan.org/~unobe/WWW-Facebook-API-v0.4.2/
Facebook API implementation
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: 16 Jul 2007 13:39:51 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: searching for a special string in an array
Message-Id: <slrnf9mt97.6km.glennj@smeagol.ncf.ca>
At 2007-07-10 03:18AM, "Shai" wrote:
> Hi,
>
> I'm running on an array of strings with a foreach loop.
> I want to stop the loop when I find the string: "item(s)" - but it
> looks like I have problems with defining the if condition.
> I tried:
> if ($str=~"item(s)") {
In addition to all the other advice given, if that's the exact string
you're looking for, use 'eq' instead of regex matching:
if ($str eq "item(s)") { ...
--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
------------------------------
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 654
**************************************