[30723] in Perl-Users-Digest
Perl-Users Digest, Issue: 1968 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 7 03:09:52 2008
Date: Fri, 7 Nov 2008 00:09:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 7 Nov 2008 Volume: 11 Number: 1968
Today's topics:
Re: A couple of questions regarding runtime generation sln@netherlands.com
Re: Envirnoment (?) question [LONG] <thumain.the@invalid.invalid>
Re: Envirnoment (?) question <whynot@pozharski.name>
Re: Envirnoment (?) question <thumain.the@invalid.invalid>
Re: Envirnoment (?) question <thumain.the@invalid.invalid>
Re: Envirnoment (?) question sln@netherlands.com
Re: Envirnoment (?) question <thumain.the@invalid.invalid>
Re: hash array loop in sequence? <whynot@pozharski.name>
Re: Help: How can I parse this properties file? sln@netherlands.com
Re: Help: How can I parse this properties file? sln@netherlands.com
Re: Is there a perl package, or data in a form easily u <nospam-abuse@ilyaz.org>
Re: Is there a perl package, or data in a form easily u <r.ted.byers@gmail.com>
Re: Is there a perl package, or data in a form easily u <r.ted.byers@gmail.com>
new CPAN modules on Fri Nov 7 2008 (Randal Schwartz)
Re: Odd regular expression behaviour <whynot@pozharski.name>
Re: Odd regular expression behaviour <joe@inwap.com>
Re: Substitution sln@netherlands.com
Re: Substitution <rcaputo@pobox.com>
SUBSTR() with replacement or lvalue performance issues sln@netherlands.com
Re: SUBSTR() with replacement or lvalue performance iss xhoster@gmail.com
Re: SUBSTR() with replacement or lvalue performance iss sln@netherlands.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 07 Nov 2008 01:29:34 GMT
From: sln@netherlands.com
Subject: Re: A couple of questions regarding runtime generation of REGEXP's
Message-Id: <q967h4hi41tpr393gnc7gppdd0eh8ina4p@4ax.com>
On Wed, 05 Nov 2008 19:54:14 GMT, sln@netherlands.com wrote:
>On Wed, 05 Nov 2008 00:31:44 GMT, sln@netherlands.com wrote:
>
>>On Tue, 04 Nov 2008 12:23:07 +0100, Michele Dondi <bik.mido@tiscalinet.it> wrote:
>>
>>>On Mon, 03 Nov 2008 23:01:35 GMT, sln@netherlands.com wrote:
>>>
>>>>In my opinion, s///g should be allowed by qr{} using the scoping block it was created
>>>>in, and later correctly used (s///g) within the context of a block that invokes the engine.
>>>>
>>>>This may violate 'first-order object' of the language. But then why are code extensions allowed?
>>>>qr/(?{ code })/ and what is the scoping for them? To me this looks like parsing issues and
>>>>if allowed would would internally result in a dynamic code issue like eval.
>>>>I don't that this 'code' extension isn't treated as a literal anyway.
>>>
>>>Do not misunderstand me, I'm all with you: would you write a Perl
>>>extension that allows to treat substitutions as first order objects of
>>>the language? I would cherish that... Unfortunately I *for one*
>>>haven't the slightest idea of where one could begin!
>>>
>>>In the meanwhile we must be happy with a clumsier solution, like...
>>>
>>>>I don't know if invoking a 'sub' (/e) is going to be any better than having to
>>>>parse through a passed in argument list for the proper form. In all cases, it looks
>>>>like the replacement text cannot include special var's unles an eval is used
>>>>at runtime.
>>>>
>>>>Can you give an example of your regex and a sub solution?
>>>
>>>... sure:
>>>
>>> my %subst = ( regex => qr/.../, code => sub { ... } );
>>>
>>>And then you use that to perform the substitution. You may even make
>>>that the core data of a class, thus allowing objects like $subst with
>>>a suitable ->apply($string) method.
>>>
>>>
>>>Michele
>>
>[snip]
>>
>>This is a relief for me though. Thanks alot...
>>
>[snip]
>>
>
>I settled on this lightweight class that handles the substution with some
>variable type's. Still it is with minimal error checking to reduce overhead.
>Added a few methods to generalize access, and it benchmarks pretty good.
>
>See any potential problems or performance issues ?
>
>sln
>
>----------------------
>use strict;
>use warnings;
>
>my $data = "This(1) is some data, this(2) gets substituted,
>and so does this(3).";
>my $tempdata = $data;
>
>my $rxp = RxP->new (
> 'regex' => qr/(\whis\(\d\))/si,
> 'code' => sub { print "code: \$1 = $1\n"; return 'That'; },
> 'type' => 'r'
>);
>
># test apply, set/get_type methods
>if (1)
>{
> print "\n","-"x20,"\nData = $data\n\n";
>
> $rxp->set_type('s');
> if ($rxp->apply ($data)) {
> print "Apply '".$rxp->get_type."' worked, data = $data\n\n";
> }
> $rxp->set_type('r');
> if ($rxp->apply ($data)) {
> print "Apply '".$rxp->get_type."' worked, data = $data\n\n";
> }
> $rxp->set_type('g');
> if ($rxp->apply ($data)) {
> print "Apply '".$rxp->get_type."' worked, data = $data\n\n";
> }
>}
>
># test direct call and search, replace, replace_g methods
>if (1)
>{
> $rxp->set_type('r');
> $data = $tempdata;
> print "\n","-"x20,"\nData = $data\n\n";
>
> if ($rxp->{'dflt_sub'}($rxp, $data)) {
> print "Direct {dflt_sub} worked, data = $data\n\n";
> }
> if ($rxp->search ($data)) {
> print "Search worked, data = $data\n\n";
> }
> if ($rxp->replace ($data)) {
> print "Replace worked, data = $data\n\n";
> }
> if ($rxp->replace_g ($data)) {
> print "Global replace worked, data = $data\n\n";
> }
>}
>
>
>package RxP;
>use vars qw(@ISA);
>@ISA = qw();
>
[snip]
Its better to have the regexp fail for some other reason than
undefined'ness.
Performance benchmarks are very good. Thx...
sub new
{
my ($class, @args) = @_;
my $self = {
'regex' => '',
'code' => '',
'type' => 's',
'dflt_sub' => \&search,
};
while (my ($name, $val) = splice (@args, 0, 2)) {
next if (!defined $val);
if ('regex' eq lc $name) {
$self->{'regex'} = $val;
}
elsif ('code' eq lc $name) {
$self->{'code'} = $val;
}
elsif ('type' eq lc $name && $val =~ /(s|r|g)/i) {
set_type ($self, $1);
}
}
return bless ($self, $class);
}
>sub get_type
>{
> return $_[0]->{'type'};
>}
>sub set_type
>{
> return 0 unless (defined $_[1]);
> if ($_[1] =~ /(s|r|g)/i) {
> $_[0]->{'dflt_sub'} = {
> 's' => \&search,
> 'r' => \&replace,
> 'g' => \&replace_g
> }->{$1};
> $_[0]->{'type'} = $1;
> return 1;
> }
> return 0;
>}
>sub apply
>{
> return 0 unless (defined $_[1]);
> return &{$_[0]->{'dflt_sub'}};
>}
>sub search
>{
> return 0 unless (defined $_[1]);
> return $_[1] =~ /$_[0]->{'regex'}/;
>}
>sub replace
>{
> return 0 unless (defined $_[1]);
> return $_[1] =~ s/$_[0]->{'regex'}/&{$_[0]->{'code'}}/e;
>}
>sub replace_g
>{
> return 0 unless (defined $_[1]);
> return $_[1] =~ s/$_[0]->{'regex'}/&{$_[0]->{'code'}}/ge;
>}
>
>__END__
>
>--------------------
>Data = This(1) is some data, this(2) gets substituted,
>and so does this(3).
>
>Apply 's' worked, data = This(1) is some data, this(2) gets substituted,
>and so does this(3).
>
>code: $1 = This(1)
>Apply 'r' worked, data = That is some data, this(2) gets substituted,
>and so does this(3).
>
>code: $1 = this(2)
>code: $1 = this(3)
>Apply 'g' worked, data = That is some data, That gets substituted,
>and so does That.
>
>
>--------------------
>Data = This(1) is some data, this(2) gets substituted,
>and so does this(3).
>
>code: $1 = This(1)
>Direct {dflt_sub} worked, data = That is some data, this(2) gets substituted,
>and so does this(3).
>
>Search worked, data = That is some data, this(2) gets substituted,
>and so does this(3).
>
>code: $1 = this(2)
>Replace worked, data = That is some data, That gets substituted,
>and so does this(3).
>
>code: $1 = this(3)
>Global replace worked, data = That is some data, That gets substituted,
>and so does That.
>
>
>
>
------------------------------
Date: Fri, 07 Nov 2008 08:36:04 +0100
From: "Thumain Th." <thumain.the@invalid.invalid>
Subject: Re: Envirnoment (?) question [LONG]
Message-Id: <op.uj8neecniwlx6x@jbxp.scrim.fr>
Le Fri, 07 Nov 2008 01:00:44 +0100, Eric Pozharski <whynot@pozharski.name>
a écrit:
> On 2008-11-06, Thumain Th. <thumain.the@invalid.invalid> wrote:
> *SKIP*
>
Thanks for your answer , s
>> On one of our systems XMLin
>
> Please explain difference between 'one of' and 'our systems'.
>
Excellent question!
Same file and program runs OK on all our systems but not on THIS one.
THIS system is Suse 9.3 , perl 5.8.6 and old 5.000503 leaves
in/usr/local/lib/perl5/... , development
environment was migrated to this machine , perl 5.8.6 was installed and
many modules (including XML , ...)
were just copied from original /usr/local/lib/perl5/5.0000503 to same
directories (ie NOT 5.8.6) on this
system. They seem to function OK.
Other systems are RH 7.2/perl 5.000503 ,RH 6 and other linux flavors.
One of our customers runs same system as THIS and program and file run OK
on it...
>> crashes with 'illecal xml character' (file.xml is OK).
>
> Please copy-paste exact and full messages.
>
> *CUT*
>
XML::SAX::Exception::throw('XML::SAX::Exception::Parse', 'Message',
'Not a v
alid XML character: \'=\'') called at
/usr/lib/perl5/vendor_perl/5.8.6/XML/
SAX/PurePerl/Reader.pm line 92
XML::SAX::PurePerl::Reader::match('XML::SAX::PurePerl::Reader::Stream=ARRAY(
0x890df10)', '=') called at
/usr/lib/perl5/vendor_perl/5.8.6/XML/SAX/PurePerl/XM
LDecl.pm line 52
I did not insert error message since same program and file correctly
function on
other systems. Trying to find why on THIS system ,file parses OK under
debugger not in program with
same instructions.
Thanks for time spent reading posts....
--
TT
------------------------------
Date: Fri, 07 Nov 2008 02:00:44 +0200
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: Envirnoment (?) question
Message-Id: <slrngh719n.v5f.whynot@orphan.zombinet>
On 2008-11-06, Thumain Th. <thumain.the@invalid.invalid> wrote:
*SKIP*
> On one of our systems XMLin
Please explain difference between 'one of' and 'our systems'.
> crashes with 'illecal xml character' (file.xml is OK).
Please copy-paste exact and full messages.
*CUT*
--
Torvalds' goal for Linux is very simple: World Domination
------------------------------
Date: Fri, 07 Nov 2008 07:43:52 +0100
From: "Thumain Th." <thumain.the@invalid.invalid>
Subject: Re: Envirnoment (?) question
Message-Id: <op.uj8kzexriwlx6x@jbxp.scrim.fr>
Le Thu, 06 Nov 2008 18:31:40 +0100, Sherm Pendley <spamtrap@dot-app.org> a
écrit:
> "Thumain Th." <thumain.the@invalid.invalid> writes:
>
>> Hi,
>>
>> Sorry with this strange problem.
>> We use XML::Simple to parse small xml files.
>> Program was shortened to
>>
>> use strict;
>> use XML::Simple;
>> my $ref=XMLin('/var/tmp/file.xml')
>>
>> On one of our systems XMLin crashes with 'illecal xml character'
>> (file.xml is OK).
>
> The error you're getting says that the file is not OK. Have you used a
> different tool to verify that the XML is in fact well-formed and (if it
> has a DTD) valid?
>
> sherm--
>
Yes it is , and is parsed OK under debugger.
--
TT
------------------------------
Date: Fri, 07 Nov 2008 08:19:30 +0100
From: "Thumain Th." <thumain.the@invalid.invalid>
Subject: Re: Envirnoment (?) question
Message-Id: <op.uj8mmsyjiwlx6x@jbxp.scrim.fr>
Le Thu, 06 Nov 2008 21:51:21 +0100, Tad J McClellan <tadmc@seesig.invalid>
a écrit:
> Thumain Th. <thumain.the@invalid.invalid> wrote:
>
>> On one of our systems XMLin crashes with 'illecal xml character'
>> (file.xml
>> is OK).
>
>
> Please copy and paste error messages rather than attempting to retype
> them.
>
>
Thanks for your answer , here is 1st line of STDERR:
XML::SAX::Exception::throw('XML::SAX::Exception::Parse', 'Message',
'Not a v
alid XML character: \'=\'') called at
/usr/lib/perl5/vendor_perl/5.8.6/XML/
SAX/PurePerl/Reader.pm line 92
XML::SAX::PurePerl::Reader::match('XML::SAX::PurePerl::Reader::Stream=ARRAY(
0x890df10)', '=') called at
/usr/lib/perl5/vendor_perl/5.8.6/XML/SAX/PurePerl/XM
LDecl.pm line 52
I did not insert error message since same program and file correctly
function on
other systems. Trying to find why on THIS system ,file parses OK under
debugger not in program with
same instructions.
--
TT
------------------------------
Date: Fri, 07 Nov 2008 07:33:28 GMT
From: sln@netherlands.com
Subject: Re: Envirnoment (?) question
Message-Id: <1ar7h455mic31kt732ltcjgjn8l63vjga6@4ax.com>
On Fri, 07 Nov 2008 07:43:52 +0100, "Thumain Th." <thumain.the@invalid.invalid> wrote:
>Le Thu, 06 Nov 2008 18:31:40 +0100, Sherm Pendley <spamtrap@dot-app.org> a
>écrit:
>
>> "Thumain Th." <thumain.the@invalid.invalid> writes:
>>
>>> Hi,
>>>
>>> Sorry with this strange problem.
>>> We use XML::Simple to parse small xml files.
>>> Program was shortened to
>>>
>>> use strict;
>>> use XML::Simple;
>>> my $ref=XMLin('/var/tmp/file.xml')
>>>
>>> On one of our systems XMLin crashes with 'illecal xml character'
>>> (file.xml is OK).
>>
>> The error you're getting says that the file is not OK. Have you used a
>> different tool to verify that the XML is in fact well-formed and (if it
>> has a DTD) valid?
>>
>> sherm--
>>
>Yes it is , and is parsed OK under debugger.
I wouldn't think Simple requires DTD or any thing else.
In fact I know thats not the case. I don't know the default
parser Simple uses, but Simple is not in itself a parser.
I never passed it a file name. Does it do that? Usually an open file
handle is passed in leu of an xml string. Pass some junk xml string and
see if it works. Some content at root level. Try to invoke an exception.
Try these two lines:
use XML::Simple;
$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
I never use Simple anymore, I have my own complete package I have
written with many tools. Man that Expat though, its nightmare fast
but has got nothing else.
sln
------------------------------
Date: Fri, 07 Nov 2008 08:39:48 +0100
From: "Thumain Th." <thumain.the@invalid.invalid>
Subject: Re: Envirnoment (?) question
Message-Id: <op.uj8nkmssiwlx6x@jbxp.scrim.fr>
Le Fri, 07 Nov 2008 08:33:28 +0100, <sln@netherlands.com> a écrit:
> On Fri, 07 Nov 2008 07:43:52 +0100, "Thumain Th."
> <thumain.the@invalid.invalid> wrote:
>
[...]
>>> The error you're getting says that the file is not OK. Have you used a
>>> different tool to verify that the XML is in fact well-formed and (if it
>>> has a DTD) valid?
>>>
>>> sherm--
>>>
>> Yes it is , and is parsed OK under debugger.
>
> I wouldn't think Simple requires DTD or any thing else.
> In fact I know thats not the case. I don't know the default
> parser Simple uses, but Simple is not in itself a parser.
>
Right , no DTD and uses SAX
> I never passed it a file name. Does it do that? Usually an open file
> handle is passed in leu of an xml string. Pass some junk xml string and
> see if it works. Some content at root level. Try to invoke an exception.
>
It works , since same program and xml file run OK on other systems or
under perl debugger.
> Try these two lines:
>
> use XML::Simple;
> $XML::Simple::PREFERRED_PARSER = 'XML::Parser';
>
Shall try it
> I never use Simple anymore, I have my own complete package I have
> written with many tools. Man that Expat though, its nightmare fast
> but has got nothing else.
>
> sln
Thanks.
--
TT
------------------------------
Date: Fri, 07 Nov 2008 01:38:41 +0200
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: hash array loop in sequence?
Message-Id: <slrngh700b.v5f.whynot@orphan.zombinet>
On 2008-11-06, Eric Pozharski <whynot@pozharski.name> wrote:
*SKIP*
> It is looking for an array (I<-w> rocks):
Oh no, I did it again. B<foreach> is looking for list.
*CUT*
--
Torvalds' goal for Linux is very simple: World Domination
------------------------------
Date: Thu, 06 Nov 2008 23:34:53 GMT
From: sln@netherlands.com
Subject: Re: Help: How can I parse this properties file?
Message-Id: <b7u6h41841i3esft1vaumifkob6fvbpn1u@4ax.com>
On Wed, 5 Nov 2008 05:23:58 -0800 (PST), "yuanyun.ken" <yuanyun.ken@gmail.com> wrote:
>Hi, dear all perl users:
>Recently I need read in a proerties file,
>its format is key=value, and it uses \ to escape.
>for example:
>expression means: key value
>a=b=c a b=c
>a\=b=c a=b c
>a\\=b=c a\ b=c
>a\\\=b=c a\=b c
>
>How can I parse this file?
>I think it should use regex.
>but my knowledage in Regular expression is poor.
>any help is greatly appreciated.
Well, according to your template there, the valid
equal sign separating Key from Value is the first
non-escaped equal sign.
So yes there is a regular expression to do that.
You have data in the escaped form. It can be split up
into key and value using those rules in a regexp, then
unescape the key/val pair.
Below is probably no different than the other suggestions
in terms of how the split occurs using a regex.
Where does this sequence take you? Do you expect the value
side to be escaped?
These appear possible as well, is this something that will be
encountered?
a\\\\=b=c a\\ b=c
a\\\=b\\=c a\=b\ c
a\\=b\\=c a\ b\=c
Like the other possiblities, here is one more. Its hard to see how
you would get a simple one-step solution though. Maybe..
Good luck.
sln
# ** Original
# expression means: key value
# a=b=c a b=c
# a\=b=c a=b c
# a\\=b=c a\ b=c
# a\\\=b=c a\=b c
# ** Output
# a=b=c a b=c
# a\=b=c a=b c
# a\\=b=c a\ b=c
# a\\\=b=c a\=b c
# a\\\\=b=c a\\ b=c
# a\\\=b\\=c a\=b\ c
# a\\=b\\=c a\ b\=c
use strict;
use warnings;
my @property = ();
foreach my $line ( <DATA> ) {
chomp $line;
push @property, $line if (length $line);
}
print "\nexpression means:\tkey\tvalue\n";
for (@property)
{
if (/^((?:(?:\\.)*?|.*?)+)=(.*)$/)
{
# unescape built in sequences
my ($key, $val) = ($1,$2);
$key =~ s/\\(.)/$1/g;
$val =~ s/\\(.)/$1/g;
printf "%-20s\t%s\t%s\n", $_, $key, $val;
}
}
__DATA__
a=b=c
a\=b=c
a\\=b=c
a\\\=b=c
a\\\\=b=c
a\\\=b\\=c
a\\=b\\=c
------------------------------
Date: Thu, 06 Nov 2008 23:52:50 GMT
From: sln@netherlands.com
Subject: Re: Help: How can I parse this properties file?
Message-Id: <pm07h451er0gvr42va1666mvlitjk3js2l@4ax.com>
On Thu, 06 Nov 2008 23:34:53 GMT, sln@netherlands.com wrote:
>On Wed, 5 Nov 2008 05:23:58 -0800 (PST), "yuanyun.ken" <yuanyun.ken@gmail.com> wrote:
>
>>Hi, dear all perl users:
>>Recently I need read in a proerties file,
>>its format is key=value, and it uses \ to escape.
>>for example:
>>expression means: key value
>>a=b=c a b=c
>>a\=b=c a=b c
>>a\\=b=c a\ b=c
>>a\\\=b=c a\=b c
>>
>>How can I parse this file?
>>I think it should use regex.
>>but my knowledage in Regular expression is poor.
>>any help is greatly appreciated.
>
>
>Well, according to your template there, the valid
>equal sign separating Key from Value is the first
>non-escaped equal sign.
>
>So yes there is a regular expression to do that.
>You have data in the escaped form. It can be split up
>into key and value using those rules in a regexp, then
>unescape the key/val pair.
>
>Below is probably no different than the other suggestions
>in terms of how the split occurs using a regex.
>
>Where does this sequence take you? Do you expect the value
>side to be escaped?
>
>These appear possible as well, is this something that will be
>encountered?
>
>a\\\\=b=c a\\ b=c
>a\\\=b\\=c a\=b\ c
>a\\=b\\=c a\ b\=c
>
>Like the other possiblities, here is one more. Its hard to see how
>you would get a simple one-step solution though. Maybe..
>
>Good luck.
>sln
>
># ** Original
># expression means: key value
># a=b=c a b=c
># a\=b=c a=b c
># a\\=b=c a\ b=c
># a\\\=b=c a\=b c
>
># ** Output
># a=b=c a b=c
># a\=b=c a=b c
># a\\=b=c a\ b=c
># a\\\=b=c a\=b c
># a\\\\=b=c a\\ b=c
># a\\\=b\\=c a\=b\ c
># a\\=b\\=c a\ b\=c
>
>
>use strict;
>use warnings;
>
[snip]
You could minimalize it as well.
foreach ( <DATA> ) {
chomp;
if (/^((?:(?:\\.)*?|.*?)+)=(.*)$/)
{
# unescape built in sequences
my ($key, $val) = ($1,$2);
$key =~ s/\\(.)/$1/g;
$val =~ s/\\(.)/$1/g;
printf "%-20s\t%s\t%s\n", $_, $key, $val;
}
}
>
>__DATA__
>a=b=c
>a\=b=c
>a\\=b=c
>a\\\=b=c
>a\\\\=b=c
>a\\\=b\\=c
>a\\=b\\=c
------------------------------
Date: Fri, 7 Nov 2008 01:25:41 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Is there a perl package, or data in a form easily used by a perl script, that can be used to determine when to change to or from daylight savings time?
Message-Id: <gf05el$nfa$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Ted Byers
<r.ted.byers@gmail.com>], who wrote in article <ebcdea05-d888-49b5-85d7-af75cd4996b8@d36g2000prf.googlegroups.com>:
> However, in many localities, there is a need to switch to and from a
> daylight savings time, and I can use the time zones defined in
> Date::Manip to specify which users would be using daylight savings
> time, but the problem is that using something like "EST5EDT" in either
> $from or $to Date_ConvTZ($date1,$from,$to1); does nothing (i.e. the
> value returned is identical to $date1). In some respects, I was not
> very surprised: unless there was some kind of database hidden in the
> bowels of Date::Manip, it couldn't know when to switch to or from
> daylight savings time based on the value of $date1.
There is a notion of "timezone". A timezone uniquely determines the
mapping GMT --> local time. "EST5EDT" is not a timezone.
E.g., on this computer, I do
>echo $TZ
US/Pacific
It is a function of kernel/CRT library to have a database of
timezones. On capable systems, you should do
$ENV{TZ} = 'US/Pacific';
POSIX::settz(); # sp? tzset()?
print scalar localtime time;
and get the correct local time.
Hope this helps,
Ilya
------------------------------
Date: Thu, 6 Nov 2008 18:09:01 -0800 (PST)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Re: Is there a perl package, or data in a form easily used by a perl script, that can be used to determine when to change to or from daylight savings time?
Message-Id: <0b1bd518-16d0-45f3-9458-f58a88830c99@a17g2000prm.googlegroups.com>
On Nov 6, 8:25=A0pm, Ilya Zakharevich <nospam-ab...@ilyaz.org> wrote:
> [A complimentary Cc of this posting was sent to
> Ted Byers
> <r.ted.by...@gmail.com>], who wrote in article <ebcdea05-d888-49b5-85d7-a=
f75cd499...@d36g2000prf.googlegroups.com>:
>
> > However, in many localities, there is a need to switch to and from a
> > daylight savings time, and I can use the time zones defined in
> > Date::Manip to specify which users would be using daylight savings
> > time, but the problem is that using something like "EST5EDT" in either
> > $from or $to Date_ConvTZ($date1,$from,$to1); does nothing (i.e. the
> > value returned is identical to $date1). =A0In some respects, I was not
> > very surprised: unless there was some kind of database hidden in the
> > bowels of Date::Manip, it couldn't know when to switch to or from
> > daylight savings time based on the value of $date1.
>
> There is a notion of "timezone". =A0A timezone uniquely determines the
> mapping GMT --> local time. =A0"EST5EDT" is not a timezone.
>
True. But Date::Manip uses it as a convention for indicating that the
machine uses both EST and EDT. It works OK when I am working on times
relevant to my local machine. But my current problem is that the
times in question are stored in a database in UTC times, and really
have nothing to do with the timezone that applies to the server
running the DB. It is in the midwest US while the institution that is
the source of the data is in central Europe and we have clients on,
for example, the west coast of the US.
> E.g., on this computer, I do
>
> =A0 =A0>echo $TZ
> =A0 =A0US/Pacific
>
> It is a function of kernel/CRT library to have a database of
> timezones. =A0On capable systems, you should do
>
> =A0 =A0$ENV{TZ} =3D 'US/Pacific';
> =A0 =A0POSIX::settz(); =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# sp? =
=A0tzset()?
> =A0 =A0print scalar localtime time;
>
> and get the correct local time.
>
> Hope this helps,
> Ilya
What you suggest is applicable to various tasks on my own machine, but
actually I already have that working already. My problem involves
converting times that apply to one institution on the other side of
the planet into timezones that are on the other side of this
continent. I don't see how working wih my own local time helps.
Thanks anyway Ilya
------------------------------
Date: Thu, 6 Nov 2008 18:12:43 -0800 (PST)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Re: Is there a perl package, or data in a form easily used by a perl script, that can be used to determine when to change to or from daylight savings time?
Message-Id: <40659ad5-9751-4528-9a5c-8159016e122f@g17g2000prg.googlegroups.com>
On Nov 6, 5:13=A0pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
> Ted Byers wrote:
> > NB: I have seen information about using the system's settings, but
> > that is not relevant to this problem.
>
> Could the subject be a little longer???
>
I could try to get it longer, but my fingers would get too tired. ;-)
>
>
> > I have a number of DB tables that have datetime values defined WRT UTC
> > time. =A0If all users could/would work with UTC, there'd be no problem.
> > I have stored, in a users table, the users' specific timezones. =A0So
> > far so good. =A0I can use Date::Manip to convert from UTC to each user'=
s
> > timezone easily. =A0That is great!
>
> > However, in many localities, there is a need to switch to and from a
> > daylight savings time, and I can use the time zones defined in
> > Date::Manip to specify which users would be using daylight savings
>
> [...]
>
> It's saving daylight, so there's only one 's' in daylight saving time.
>
> Lots of help/discussions/people who can help at:
>
> http://datetime.perl.org/
OK Thanks. I'll take a look there and see what progress I can make.
Thanks
Ted
------------------------------
Date: Fri, 7 Nov 2008 05:42:22 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Nov 7 2008
Message-Id: <K9y7uM.1z7q@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.
Algorithm-FloodControl-1.92
http://search.cpan.org/~gugu/Algorithm-FloodControl-1.92/
Limit event processing to count/time ratio.
----
Algorithm-FloodControl-1.93
http://search.cpan.org/~gugu/Algorithm-FloodControl-1.93/
Limit event processing to count/time ratio.
----
Algorithm-FloodControl-1.95
http://search.cpan.org/~gugu/Algorithm-FloodControl-1.95/
Limit event processing to count/time ratio.
----
Algorithm-FloodControl-1.96
http://search.cpan.org/~gugu/Algorithm-FloodControl-1.96/
Limit event processing to count/time ratio.
----
AnyEvent-Mojo-0.6
http://search.cpan.org/~melo/AnyEvent-Mojo-0.6/
Start async Mojo servers easly
----
AnyEvent-Mojo-0.6001
http://search.cpan.org/~melo/AnyEvent-Mojo-0.6001/
Start async Mojo servers easly
----
App-ZofCMS-0.0107
http://search.cpan.org/~zoffix/App-ZofCMS-0.0107/
web framework and templating system for small-medium sites.
----
App-ZofCMS-Plugin-Debug-Validator-HTML-0.0101
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-Debug-Validator-HTML-0.0101/
debugging plugin for auto validating HTML
----
Biblio-LCC-0.09
http://search.cpan.org/~nkuitse/Biblio-LCC-0.09/
parse and normalize LC-style call numbers
----
Business-DK-CPR-0.04
http://search.cpan.org/~jonasbn/Business-DK-CPR-0.04/
a Danish CPR code generator/validator
----
CGI-Application-Gallery-1.09
http://search.cpan.org/~leocharre/CGI-Application-Gallery-1.09/
image gallery module
----
CGI-IDS-1.0101
http://search.cpan.org/~hinnerk/CGI-IDS-1.0101/
PerlIDS - Perl Website Intrusion Detection System (XSS, CSRF, SQLI, LFI etc.)
----
CPAN-Testers-ParseReport-0.0.18
http://search.cpan.org/~andk/CPAN-Testers-ParseReport-0.0.18/
parse reports to www.cpantesters.org from various sources
----
Catalyst-Controller-RateLimit-0.23
http://search.cpan.org/~gugu/Catalyst-Controller-RateLimit-0.23/
Protect your site from robots
----
Catalyst-Controller-RequestToken-0.02
http://search.cpan.org/~hide/Catalyst-Controller-RequestToken-0.02/
Handling transaction token across forms
----
Catalyst-Controller-RequestToken-0.03
http://search.cpan.org/~hide/Catalyst-Controller-RequestToken-0.03/
Handling transaction token across forms
----
Data-Visitor-Encode-0.10002
http://search.cpan.org/~dmaki/Data-Visitor-Encode-0.10002/
Encode/Decode Values In A Structure
----
Devel-SearchINC-1.37
http://search.cpan.org/~marcel/Devel-SearchINC-1.37/
loading Perl modules from their development dirs
----
Digest-Skein-0.00_03
http://search.cpan.org/~radek/Digest-Skein-0.00_03/
Perl interface to the Skein digest algorithm
----
ExtUtils-Install-1.50_05
http://search.cpan.org/~yves/ExtUtils-Install-1.50_05/
install files from here to there
----
File-Dir-Dumper-0.0.3
http://search.cpan.org/~shlomif/File-Dir-Dumper-0.0.3/
dump directory structures' meta-data in a consistent and machine-readable way.
----
GD-Chord-Piano-0.0.2
http://search.cpan.org/~bayashi/GD-Chord-Piano-0.0.2/
Generate Chord Table of Piano
----
Geo-Coordinates-OSGB-2.03
http://search.cpan.org/~toby/Geo-Coordinates-OSGB-2.03/
Convert Coordinates between Lat/Lon and the British National Grid.
----
Geo-Coordinates-OSGB-2.04
http://search.cpan.org/~toby/Geo-Coordinates-OSGB-2.04/
Convert coordinates between Lat/Lon and the British National Grid
----
Geo-OSM-MapFeatures-0.01
http://search.cpan.org/~bobkare/Geo-OSM-MapFeatures-0.01/
Parses and represents OpenStreetMap Map Features
----
Getopt-XML-0.50
http://search.cpan.org/~rglaue/Getopt-XML-0.50/
Provide the user input arguments to Getopt::Long as an XML document
----
Hook-LexWrap-0.21
http://search.cpan.org/~chorny/Hook-LexWrap-0.21/
Lexically scoped subroutine wrappers
----
IO-Lambda-0.36
http://search.cpan.org/~karasik/IO-Lambda-0.36/
non-blocking I/O in lambda style
----
IO-Lambda-0.37
http://search.cpan.org/~karasik/IO-Lambda-0.37/
non-blocking I/O in lambda style
----
IPC-Messaging-0.01_12
http://search.cpan.org/~gruber/IPC-Messaging-0.01_12/
process handling and message passing, Erlang style
----
Lighttpd-Control-0.02
http://search.cpan.org/~stevan/Lighttpd-Control-0.02/
Simple class to manage a Lighttpd server
----
Mojo-0.8006
http://search.cpan.org/~sri/Mojo-0.8006/
The Web In A Box!
----
MooseX-Role-Cmd-0.03
http://search.cpan.org/~isillitoe/MooseX-Role-Cmd-0.03/
Wrap system command binaries the Moose way
----
Moxy-0.47
http://search.cpan.org/~tokuhirom/Moxy-0.47/
Mobile web development proxy
----
Moxy-0.48
http://search.cpan.org/~tokuhirom/Moxy-0.48/
Mobile web development proxy
----
Net-Interface-0.13_01
http://search.cpan.org/~rehsack/Net-Interface-0.13_01/
Perl extension to access network interfaces
----
Net-LDAP-Class-0.15
http://search.cpan.org/~karman/Net-LDAP-Class-0.15/
object-relational mapper for Net::LDAP
----
Net-SFTP-Foreign-1.45_07
http://search.cpan.org/~salva/Net-SFTP-Foreign-1.45_07/
SSH File Transfer Protocol client
----
PDL-2.4.3_06
http://search.cpan.org/~chm/PDL-2.4.3_06/
the Perl Data Language
----
Padre-Plugin-CPAN-0.02
http://search.cpan.org/~fayland/Padre-Plugin-CPAN-0.02/
CPAN in Padre
----
Padre-Plugin-CPAN-0.03
http://search.cpan.org/~fayland/Padre-Plugin-CPAN-0.03/
CPAN in Padre
----
Padre-Plugin-PluginHelper-0.03
http://search.cpan.org/~fayland/Padre-Plugin-PluginHelper-0.03/
make building Padre plugin easy
----
Padre-Plugin-PluginHelper-0.04
http://search.cpan.org/~fayland/Padre-Plugin-PluginHelper-0.04/
make building Padre plugin easy
----
Padre-Plugin-PluginHelper-0.05
http://search.cpan.org/~fayland/Padre-Plugin-PluginHelper-0.05/
make building Padre plugin easy
----
Padre-Plugin-TabAndSpace-0.06
http://search.cpan.org/~fayland/Padre-Plugin-TabAndSpace-0.06/
convert between space and tab within Padre
----
RT-Authen-ExternalAuth-0.07_01
http://search.cpan.org/~zordrak/RT-Authen-ExternalAuth-0.07_01/
RT Authentication using External Sources
----
RT-Extension-WatchedQueues-0.02
http://search.cpan.org/~elacour/RT-Extension-WatchedQueues-0.02/
List queues the user is a watcher of
----
RT-Extension-WatchedQueues-0.03
http://search.cpan.org/~elacour/RT-Extension-WatchedQueues-0.03/
List queues the user is a watcher of
----
SVN-Look-0.13.463
http://search.cpan.org/~gnustavo/SVN-Look-0.13.463/
A caching wrapper aroung the svnlook command.
----
Sledge-HTTPSession-0.02
http://search.cpan.org/~tokuhirom/Sledge-HTTPSession-0.02/
HTTP::Session to Sledge bindings
----
Statistics-Basic-1.6001
http://search.cpan.org/~jettero/Statistics-Basic-1.6001/
A collection of very basic statistics modules
----
Test-Most-0.20
http://search.cpan.org/~ovid/Test-Most-0.20/
Most commonly needed test functions and features.
----
Text-Chord-Piano-0.0.1
http://search.cpan.org/~bayashi/Text-Chord-Piano-0.0.1/
This module is a chord table generator of Piano by the text
----
Text-DHCPLeases-v0.7
http://search.cpan.org/~cvicente/Text-DHCPLeases-v0.7/
Parse DHCP leases file from ISC dhcpd.
----
Text-Template-Compact-0.1.11
http://search.cpan.org/~tate/Text-Template-Compact-0.1.11/
text base template expand module
----
Time-y2038-20081106
http://search.cpan.org/~mschwern/Time-y2038-20081106/
Versions of Perl's time functions which work beyond 2038
----
ToolSet-0.14
http://search.cpan.org/~dagolden/ToolSet-0.14/
Load your commonly-used modules in a single import
----
WITH-0.0.2
http://search.cpan.org/~powerman/WITH-0.0.2/
Configure inlined constants when loading module
----
WWW-ConfixxBackup-0.1001
http://search.cpan.org/~reneeb/WWW-ConfixxBackup-0.1001/
Create Backups with Confixx and download them via FTP
----
WWW-CookieRecipesNet-0.0101
http://search.cpan.org/~zoffix/WWW-CookieRecipesNet-0.0101/
fetch cookie recipes from http://www.cookie-recipes.net/
----
WWW-Mechanize-1.51_01
http://search.cpan.org/~petdance/WWW-Mechanize-1.51_01/
Handy web browsing in a Perl object
----
Win32-IIS-Admin-1.024
http://search.cpan.org/~mthurn/Win32-IIS-Admin-1.024/
Administer Internet Information Service on Windows
----
XML-TinyXML-0.06
http://search.cpan.org/~xant/XML-TinyXML-0.06/
Little and efficient Perl module to manage xml data.
----
XML-TreePP-XMLPath-0.50
http://search.cpan.org/~rglaue/XML-TreePP-XMLPath-0.50/
Something similar to XPath, allowing definition of paths to XML subtrees
----
tTemplate-0.1.10
http://search.cpan.org/~tate/tTemplate-0.1.10/
text base template expand module
----
tTemplate-0.1.9
http://search.cpan.org/~tate/tTemplate-0.1.9/
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: Fri, 07 Nov 2008 01:56:06 +0200
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: Odd regular expression behaviour
Message-Id: <slrngh7111.v5f.whynot@orphan.zombinet>
On 2008-11-06, Jon Combe <jcombe@gmail.com> wrote:
> Can anyone explain why the following code is not doing what I expect
> it to do ?
>
> #!/usr/bin/perl -w
>
> use strict;
>
> my $inputDateFormat = "DD-MM-YY";
>
> if ( $inputDateFormat =~ m/YY/g )
> {
> print "GOT YEAR \n";
> }
> print "ABOUT TO MATCH WITH [$inputDateFormat]\n";
> if ( $inputDateFormat =~ m/MM/g )
> {
> print "GOT MONTH\n";
> }
>
> The output I get is
>
> GOT YEAR
> ABOUT TO MATCH WITH [DD-MM-YY]
>
> I would expect it to also output "GOT MONTH"
>
> With some expermentation I have found that removing the "g" modifier
> from the end of the second match gives the correct result, but once
> matched I want to use the "pos" function which seems to only work
> correctly when you have the g modifier.
Evaluate C<m//> in list context:
perl -wle '
$x = q|abc|;
print $y if $y = $x =~ m/c/g;
print $y if $y = $x =~ m/b/g;'
1
While:
perl -wle '
$x = q|abc|;
print $y if $y = () = $x =~ m/c/g;
print $y if $y = () = $x =~ m/b/g;'
1
1
*CUT*
--
Torvalds' goal for Linux is very simple: World Domination
------------------------------
Date: Thu, 06 Nov 2008 21:42:48 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Odd regular expression behaviour
Message-Id: <WPidnRvVAdrOSI7UnZ2dnUVZ_hCdnZ2d@comcast.com>
Jon Combe wrote:
> With some expermentation I have found that removing the "g" modifier
> from the end of the second match gives the correct result, but once
> matched I want to use the "pos" function which seems to only work
> correctly when you have the g modifier.
You don't have to use pos(); the @- and @+ variables have the same info.
perldoc perlvar
@LAST_MATCH_END
@+ This array holds the offsets of the ends of the last successful
submatches in the currently active dynamic scope.
-Joe
------------------------------
Date: Fri, 07 Nov 2008 01:17:02 GMT
From: sln@netherlands.com
Subject: Re: Substitution
Message-Id: <gm57h45bc5q0pqc6o5fpalf38va4tofrc1@4ax.com>
On Wed, 5 Nov 2008 22:17:37 -0800 (PST), Vishal G <v3gupta@gmail.com> wrote:
>Hi Guys,
>
>A Simple Substitution Problem
>
> my $dna =
>"***********acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******";
>
> # I want to replace asterisk(*) with dot(.) if 10 or more
>asterisks occur together
>
> $dna =~ s/\*{10,}/./g;
>
> print "$dna\n";
>
> # output
>
> .acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******
>
> As you can see 10 or more asterisk are replaced with dot but what
>I want is this
>
> ...........acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******
>
>
>How to do it
>
>Vishal
So you wan't 5,000,000 asterisks replaced with 5,000,000 dots?
Why?
sln
------------------------------
Date: Fri, 07 Nov 2008 04:39:53 GMT
From: Rocco Caputo <rcaputo@pobox.com>
Subject: Re: Substitution
Message-Id: <slrngh7hno.1ct.rcaputo@eyrie.homenet>
On Wed, 5 Nov 2008 22:17:37 -0800 (PST), Vishal G wrote:
>
> my $dna =
> "***********acgtgcta*****atctgat******actgtaaa***tttt**cccc******ccccc******";
You seem to be working with genomes. Have you looked at bioperl?
http://www.bioperl.org/wiki/Main_Page
I don't know whether it will solve your problem, but I suspect it may.
--
Rocco Caputo - http://poe.perl.org/
------------------------------
Date: Fri, 07 Nov 2008 02:17:58 GMT
From: sln@netherlands.com
Subject: SUBSTR() with replacement or lvalue performance issues
Message-Id: <9387h45bc5q0pqc6o5fpalf38va4tofra2@4ax.com>
I've read the docs on substr many a times but I still am not
quite clear on if being used as a lvalue or the replacement parameter.
I have a possible quite large string (could be megabytes).
I wan't to insert, possible in the middle a replacement text.
I'm running through an itteration on the string throught sub's etc.
Apart from like, copy from the start of a matched position, to a
file (as opposed to another buffer), then catenating the modification
to the file, then continue on with the next match, is the substr
(lvalue or replacement) a viable option?
I have to consider performance on such large operations.
What do you think would be the performance 'hit' if modifying
the string in-place using substr as either an lvalue or replacement?
There has to be some memcpy()'s or moves involved.
If replacement based, I can adjust the pos() for the next match,
but to insert even a little change in string size, in the middle
of a very large string could be a big performance hit?
All help is appretiated!
TIA
sln
------------------------------
Date: 07 Nov 2008 03:22:43 GMT
From: xhoster@gmail.com
Subject: Re: SUBSTR() with replacement or lvalue performance issues
Message-Id: <20081106222317.427$gY@newsreader.com>
sln@netherlands.com wrote:
> I've read the docs on substr many a times but I still am not
> quite clear on if being used as a lvalue or the replacement parameter.
>
> I have a possible quite large string (could be megabytes).
> I wan't to insert, possible in the middle a replacement text.
> I'm running through an itteration on the string throught sub's etc.
>
> Apart from like, copy from the start of a matched position, to a
> file (as opposed to another buffer), then catenating the modification
> to the file, then continue on with the next match,
Are you describing just the ordinary practice if writing your output to
an output file while looping over a read of the input file? That is
often a good way to do things.
> is the substr
> (lvalue or replacement) a viable option?
>
> I have to consider performance on such large operations.
>
> What do you think would be the performance 'hit' if modifying
> the string in-place using substr as either an lvalue or replacement?
On my system it takes a little under a second to use substr to splice
into the middle of a 1GB string (in a way that makes the string longer)
##baseline:
time perl -le 'my $x; $x.="x"x1000 foreach 1..1e6; \
substr $x, 4e8, 3, "yyyy" foreach 1..0 ;'
1.352u 0.904s 0:02.29 98.2% 0+0k 0+0io 0pf+0w
##20 substrs
time perl -le 'my $x; $x.="x"x1000 foreach 1..1e6; \
substr $x, 4e8, 3, "yyyy" foreach 1..0 ;'
16.585u 1.084s 0:18.31 96.4% 0+0k 0+0io 0pf+0w
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Fri, 07 Nov 2008 05:48:46 GMT
From: sln@netherlands.com
Subject: Re: SUBSTR() with replacement or lvalue performance issues
Message-Id: <a3l7h4p0jdntocviqlh71onv2bruhh2dd2@4ax.com>
On 07 Nov 2008 03:22:43 GMT, xhoster@gmail.com wrote:
>sln@netherlands.com wrote:
>> I've read the docs on substr many a times but I still am not
>> quite clear on if being used as a lvalue or the replacement parameter.
>>
>> I have a possible quite large string (could be megabytes).
>> I wan't to insert, possible in the middle a replacement text.
>> I'm running through an itteration on the string throught sub's etc.
>>
>> Apart from like, copy from the start of a matched position, to a
>> file (as opposed to another buffer), then catenating the modification
>> to the file, then continue on with the next match,
>
>Are you describing just the ordinary practice if writing your output to
>an output file while looping over a read of the input file? That is
>often a good way to do things.
>
[snip]
Yes. I'm looking at your benchmarks for substr(). I have nightmares on
if threre are like over 100,000 replacements in a gigantic string which
could easily happen. There is a block replacement, I'm not doing s///g
on a gigantic string. I'm finding a block, then acting on indirect values,
then re-inserting them in the stream. Regexp has stopped, to be re'pos()
later (or not). Depends on if a seperate file is being constructed or
the replacement is acting strictly on the buffer.
I'm looking over you benches. I have a bad feeling though. Insertion
(or deletion) several hundred thousand possible times could reek havoc
maybe.
Checking... thanks!
sln
>> is the substr
>> (lvalue or replacement) a viable option?
>>
>> I have to consider performance on such large operations.
>>
>> What do you think would be the performance 'hit' if modifying
>> the string in-place using substr as either an lvalue or replacement?
>
>On my system it takes a little under a second to use substr to splice
>into the middle of a 1GB string (in a way that makes the string longer)
>
>##baseline:
>time perl -le 'my $x; $x.="x"x1000 foreach 1..1e6; \
> substr $x, 4e8, 3, "yyyy" foreach 1..0 ;'
>1.352u 0.904s 0:02.29 98.2% 0+0k 0+0io 0pf+0w
>
>##20 substrs
>time perl -le 'my $x; $x.="x"x1000 foreach 1..1e6; \
> substr $x, 4e8, 3, "yyyy" foreach 1..0 ;'
>16.585u 1.084s 0:18.31 96.4% 0+0k 0+0io 0pf+0w
>
>Xho
------------------------------
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 1968
***************************************