[29280] in Perl-Users-Digest
Perl-Users Digest, Issue: 524 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 16 14:10:18 2007
Date: Sat, 16 Jun 2007 11:09:05 -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 Sat, 16 Jun 2007 Volume: 11 Number: 524
Today's topics:
12 hour clock and offset problem <dbroda@gmail.com>
Re: 12 hour clock and offset problem <nobull67@gmail.com>
Re: encrypt with perl, decrypt with ruby, 3 days and co <bik.mido@tiscalinet.it>
Re: Interesting PERL anamoly - confirmation and/or expl <bik.mido@tiscalinet.it>
pairwise_test <rvtol+news@isolution.nl>
Re: pairwise_test <nobull67@gmail.com>
Re: perl vs C for CGI <bik.mido@tiscalinet.it>
Re: perl vs C for CGI <rvtol+news@isolution.nl>
Re: perl vs C for CGI <hjp-usenet2@hjp.at>
Re: Runtime disparity - Same program in Perl and Ruby <bik.mido@tiscalinet.it>
Re: Runtime disparity - Same program in Perl and Ruby <bik.mido@tiscalinet.it>
Re: simple regex <bik.mido@tiscalinet.it>
Re: Strange results of "global match". <bik.mido@tiscalinet.it>
Re: Template krakle@visto.com
Re: Template <kwan.jingx@gmail.com>
Re: Template <sbryce@scottbryce.com>
Re: The Concepts and Confusions of Prefix, Infix, Postf <hjp-usenet2@hjp.at>
Re: Useless use of array element in void context <rvtol+news@isolution.nl>
Re: Which Perl 5 OO extension can be seen as "standard" <bik.mido@tiscalinet.it>
Re: Writing row at a time in Excel using OLE <cgrady357@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 16 Jun 2007 15:40:52 -0000
From: Kenetic <dbroda@gmail.com>
Subject: 12 hour clock and offset problem
Message-Id: <1182008452.783611.68010@i13g2000prf.googlegroups.com>
I'm trying to convert an input time to the offset time in a 12 hour
clock system. It's giving me a headache. The am and pm must be the
right ones when the offset is added to the input time ($temptime). I
understand it's better to use a 24 hour clock, but unfortunately I
can't in this situation. Everything needs to be done in 12-hour
format.
In short, 10:00 am with an offset of -3 should result in 1:00 pm;
10:00 pm with an offset of -3 should result in 1:00 am.
I've been at this for awhile, sadly, and cannot wrap my head around
it. Any help to point me in the right direction would be fantastic.
This is my latest version, which works to a certain extent--the
difficulty is the AM/PM to switch.
my $offset = -3;
my $tempTime = "10:00 pm";
sub myMod {
my ( $a, $b ) = @_;
my $div = $a / $b;
return $a - int( $div ) * $b;
}
sub getutc {
my $time = shift;
my $GMTOffset = shift;
$time =~ /(\d{1,2}):(\d\d)\s(.+)*/;
# Is UTC a .5 remainder? if so, chop it off--we use
# it later regardless
my $hours = $1;
if (myMod($hours,int($hours)) == -0.5) {
$hours - 0.5;
}
my $minutes = $2;
my $ampm = $3;
#Take hours and subtract whole number in Offset Time
$hours = $hours - int($GMTOffset);
if ($hours >= 12) {
$ampm = "pm";
$hours = $hours - 12
}
# If 0.5 on the Offset, then add 30 minutes and wrap
if (myMod($GMTOffset, int($GMTOffset)) == -0.5) {
$minutes = $minutes + 30;
if ($minutes >= 60) {
$minutes = $minutes % 60;
$hours = $hours + 1;
}
}
$minutes = sprintf("%02d", $minutes);
$hours = sprintf("%2d", $hours);
if ($hours == 0) { $hours = "12";}
return $hours.":".$minutes." ".$ampm;
}
my $theTime = getutc($tempTime, $offset);
print "\nCurrent time: $tempTime\n";
print "Adjust ".$offset." hours\n";
print "Adjusted to: $theTime\n";
------------------------------
Date: Sat, 16 Jun 2007 16:19:48 -0000
From: Brian McCauley <nobull67@gmail.com>
Subject: Re: 12 hour clock and offset problem
Message-Id: <1182010788.070907.146450@g4g2000hsf.googlegroups.com>
On Jun 16, 4:40 pm, Kenetic <dbr...@gmail.com> wrote:
> I'm trying to convert an input time to the offset time in a 12 hour
> clock system. It's giving me a headache. The am and pm must be the
> right ones when the offset is added to the input time ($temptime). I
> understand it's better to use a 24 hour clock, but unfortunately I
> can't in this situation. Everything needs to be done in 12-hour
> format.
What makes you think that _everything_ needs to be done in 12-hour
format?
Maybe input and output needs to be in 12-hour format but I can see no
reason why intermediate values should not be in, say, seconds or
minutes since midnight.
> In short, 10:00 am with an offset of -3 should result in 1:00 pm;
> 10:00 pm with an offset of -3 should result in 1:00 am.
> I've been at this for awhile, sadly, and cannot wrap my head around
> it. Any help to point me in the right direction would be fantastic.
>
> This is my latest version, which works to a certain extent--the
> difficulty is the AM/PM to switch.
>
> my $offset = -3;
> my $tempTime = "10:00 pm";
> sub myMod {
> my ( $a, $b ) = @_;
> my $div = $a / $b;
> return $a - int( $div ) * $b;
> }
Perl has a mod operator.
> sub getutc {
> my $time = shift;
> my $GMTOffset = shift;
> $time =~ /(\d{1,2}):(\d\d)\s(.+)*/;
You should always check the match succeeds before you use the result.
At least say "or die".
> # Is UTC a .5 remainder? if so, chop it off--we use
> # it later regardless
I don't get all that, I'll ignore it.
> my $hours = $1;
It's usually preferable you use the return value of the m// operator
rather than $1 etc.
> if (myMod($hours,int($hours)) == -0.5) {
> $hours - 0.5;
> }
> my $minutes = $2;
> my $ampm = $3;
> #Take hours and subtract whole number in Offset Time
> $hours = $hours - int($GMTOffset);
> if ($hours >= 12) {
> $ampm = "pm";
> $hours = $hours - 12
> }
> # If 0.5 on the Offset, then add 30 minutes and wrap
> if (myMod($GMTOffset, int($GMTOffset)) == -0.5) {
> $minutes = $minutes + 30;
> if ($minutes >= 60) {
> $minutes = $minutes % 60;
> $hours = $hours + 1;
> }
> }
> $minutes = sprintf("%02d", $minutes);
> $hours = sprintf("%2d", $hours);
sprintf can format several arguments at once.
> if ($hours == 0) { $hours = "12";}
> return $hours.":".$minutes." ".$ampm;
>
> }
>
> my $theTime = getutc($tempTime, $offset);
> print "\nCurrent time: $tempTime\n";
> print "Adjust ".$offset." hours\n";
> print "Adjusted to: $theTime\n";
#!perl
use strict;
use warnings;
my $offset = -3;
my $tempTime = "10:00 pm";
sub getutc {
my $time = shift;
my $GMTOffset = shift;
my ($hours,$minutes,$ampm) =
$time =~ /(\d{1,2}):(\d\d)\s*([ap]m)/ or die;
$hours += 12 if $ampm eq 'pm';
my $m = (($hours - $GMTOffset) * 60 + $minutes ) % ( 24 * 60 );
return sprintf("%2d:%02d %s",
int($m / 60 + 11 ) % 12 + 1,
$m % 60,
$m < 12 * 60 ? 'am' : 'pm');
}
my $theTime = getutc($tempTime, $offset);
print "\nCurrent time: $tempTime\n";
print "Adjust $offset hours\n";
print "Adjusted to: $theTime\n";
__END__
------------------------------
Date: Sat, 16 Jun 2007 15:20:23 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: encrypt with perl, decrypt with ruby, 3 days and counting...
Message-Id: <lro7735ffevtr3jbkouheid534440t7mmj@4ax.com>
On Thu, 14 Jun 2007 20:53:02 -0000, uncle <aktxyz@gmail.com> wrote:
>I have tried hundreds of combos, scanned hundreds of web pages, I
>still cannot encrypt with perl and decrypt with ruby. Hell, I can't
Crossposting is generally discouraged but by all means this is a
question that may have deserved it...
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: Sat, 16 Jun 2007 15:16:47 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Interesting PERL anamoly - confirmation and/or explanations welcomed
Message-Id: <mlo773tqo1nrl6n6oi4edjbran799h5bn0@4ax.com>
On Thu, 14 Jun 2007 10:37:48 -0700, Brian McCauley
<nobull67@gmail.com> wrote:
>When you interpolate a string into a regex any regex metacharacters
>are (by default) still treated as meta. (IIRC this will change in
>Perl6).
Yep: <http://dev.perl.org/perl6/doc/design/syn/S05.html>
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: Sat, 16 Jun 2007 18:03:05 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: pairwise_test
Message-Id: <f5190e.1go.1@news.isolution.nl>
Inspired by List::MoreUtils, I came up with the following.
Please comment on the name of the sub, and on any problems
you see, and on what not.
#!/usr/bin/perl
use strict;
use warnings;
# pairwise_firstidx BLOCK ARRAY1 ARRAY2 [LIST]
# returns the first index for which the BLOCK returns a defined value,
# optionally only for a list of index values
sub pairwise_do (&\@\@;@)
{
use vars qw/$a $b/;
my $op = shift; # the BLOCK
my ($caller_a, $caller_b) = do
{ my $pkg = caller();
no strict 'refs';
\*{$pkg.'::a'}, \*{$pkg.'::b'};
};
my $retval;
local (*$caller_a, *$caller_b);
for ( $_[2]
?
@_[2..$#_]
:
$[ .. $#{$_[0]} >= $#{$_[1]}
?
$#{$_[0]}
:
$#{$_[1]}
) {
(*$caller_a, *$caller_b) = \($_[0][$_], $_[1][$_]);
defined ($retval = $op->()) and return $retval;
}
return;
}
my @x = (0..6, 70..99);
my @y = (0..6, 80..99);
# find the index of the first non-equal value for
# two arrays, and within a specific index range:
print pairwise_do { $a != $b ? $_ : undef } @x, @y, 2..9;
__END__
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 16 Jun 2007 16:28:58 -0000
From: Brian McCauley <nobull67@gmail.com>
Subject: Re: pairwise_test
Message-Id: <1182011338.796207.27680@o61g2000hsh.googlegroups.com>
On Jun 16, 5:03 pm, "Dr.Ruud" <rvtol+n...@isolution.nl> wrote:
> Inspired by List::MoreUtils, I came up with the following.
> Please comment on the name of the sub, and on any problems
> you see, and on what not.
> # pairwise_firstidx BLOCK ARRAY1 ARRAY2 [LIST]
> # returns the first index for which the BLOCK returns a defined
> # value,
Well, there's your first problem. It doesn't return the index. It
returns the return value of the block.
> defined ($retval = $op->()) and return $retval;
------------------------------
Date: Sat, 16 Jun 2007 16:00:44 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl vs C for CGI
Message-Id: <47r77315u0c8oejjvqneutbok7n2tl7pe4@4ax.com>
On Fri, 15 Jun 2007 22:36:09 +0200, "Dr.Ruud"
<rvtol+news@isolution.nl> wrote:
>> A string written as a here document always
>> contains simple "\n" characters as line endings regardless of whether
>> the source file contained CRLFs or LF and whether it's executed on
>> Windows or Unix.
>
>
>And so it should. That \n is a metacharacter (line separator) that,
When he wrote "To my surprise" I suppose he meant "to my *pleasant*
surprise".
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: Sat, 16 Jun 2007 16:21:16 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: perl vs C for CGI
Message-Id: <f512up.1d0.1@news.isolution.nl>
Peter J. Holzer schreef:
> So on Unix, if you explicitely
> include literal CRLFs in your string literals (which you shouldn't,
> imho), they are silently converted to LFs.
How do you mean?
$ perl -wle'
print length <<"EOS";
abc\r
def\r
EOS
'
This prints 10, so not 8.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 16 Jun 2007 19:27:34 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: perl vs C for CGI
Message-Id: <slrnf787c6.2aq.hjp-usenet2@zeno.hjp.at>
On 2007-06-16 14:21, Dr.Ruud <rvtol+news@isolution.nl> wrote:
> Peter J. Holzer schreef:
>> So on Unix, if you explicitely
>> include literal CRLFs in your string literals (which you shouldn't,
>> imho), they are silently converted to LFs.
>
> How do you mean?
>
> $ perl -wle'
> print length <<"EOS";
> abc\r
> def\r
> EOS
> '
>
> This prints 10, so not 8.
Not if the "\r" in your code above are actual CR characters (instead of
a backslash followed by an r):
hrunkner:~ 19:20 104% perl -wle'
quote> print length <<EOS;
quote> abc^M
quote> def
quote> EOS
quote> '
8
hrunkner:~ 19:25 105% perl -wle'
print length <<EOS;
abc^K
def
EOS
'
9
perl -wle'
print length <<EOS;
abc^M^M
def
EOS
'
9
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: Sat, 16 Jun 2007 15:12:00 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Runtime disparity - Same program in Perl and Ruby
Message-Id: <obo773t05r3dfkp963oli8kriu9lh9f7a9@4ax.com>
On Thu, 14 Jun 2007 19:11:18 GMT, "John W. Krahn" <dummy@example.com>
wrote:
>Using $_ instead of the copy in $file:
>
> return if !-f || !/^\S+_\d{3}/;
Or (IMHO more clearly):
return unless -f and /^\S+_\d{3}/;
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: Sat, 16 Jun 2007 15:15:28 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Runtime disparity - Same program in Perl and Ruby
Message-Id: <sdo773do7qgrs089mibfgfqrj7ae0l6m4v@4ax.com>
On Thu, 14 Jun 2007 20:15:16 -0000, Kaldrenon <kaldrenon@gmail.com>
wrote:
>reply for making my code more "Perl"-y. I don't think many (if any)
>will actually change the way the program runs, though, will they? A
Just try.
>lot of the things I did work, but are styled more like Java, the
>language I use most. For example, I know I can just use $_ in sub
>file_seek, but I prefer to give my vars names that make more sense at
>a glance. But I'll keep all of your advice in mind.
$_ is a pronoun and it makes sense in short enough phrases. If you
have a C<for> loop with a two or three lines block (or even a C<for>
modifier) then use it. If it's 100 lines long (probably not a good
idea in its own) then use an explicit name.
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: Sat, 16 Jun 2007 16:04:29 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: simple regex
Message-Id: <8cr773hk0nsk0c31gn3udm2jarfe2mi8t6@4ax.com>
On Sat, 16 Jun 2007 09:02:16 -0000, r3gis <regis44@gmail.com> wrote:
>I did not realize that the capturing parentheses can be nested in
>another one independently of the whole regex.
Yep: <http://perlmonks.org/?node_id=442322> ;-)
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: Sat, 16 Jun 2007 15:31:06 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Strange results of "global match".
Message-Id: <7fp77355247iphm3066v567c9agja6f1db@4ax.com>
On Fri, 15 Jun 2007 14:34:30 +0200, Mirco Wahab <wahab-mail@gmx.net>
wrote:
>This is: /g and in scalar context (won't reset $str.pos() before NO_MORE_MATCH_AVAIL)
6isms already?
>You probably want' to use ($str) =~ /noSuchName/ig (list context)
Whoah, however simple and innocent it looks, it had never occurred to
me...
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: Sat, 16 Jun 2007 08:15:55 -0700
From: krakle@visto.com
Subject: Re: Template
Message-Id: <1182006955.903193.182580@n2g2000hse.googlegroups.com>
On Jun 15, 5:00 pm, kwan <kwan.ji...@gmail.com> wrote:
> On Jun 15, 4:56 pm, kra...@visto.com wrote:
>
> > On Jun 15, 3:35 pm, kwan <kwan.ji...@gmail.com> wrote:
>
> > > I used Mason for the template for my webserver, I have a very basic
> > > knowledge for the Mason. Do everyone who have experience in template
> > > for dynamic and complicated web site.
>
> > > thank you
>
> > What do you want?
> > What are you asking?
>
> You dont understand english?
You didn't ask a question nor did you state your problem. To me it
seemed as if you were just asking if "everyone who uses templates have
experience for complicated dynamic websites". If so, what difference
does it make if someone replies with a "Yes" or "No"?
------------------------------
Date: Sat, 16 Jun 2007 08:23:44 -0700
From: kwan <kwan.jingx@gmail.com>
Subject: Re: Template
Message-Id: <1182007424.803897.19600@n60g2000hse.googlegroups.com>
On Jun 16, 10:15 am, kra...@visto.com wrote:
> On Jun 15, 5:00 pm, kwan <kwan.ji...@gmail.com> wrote:
>
> > On Jun 15, 4:56 pm, kra...@visto.com wrote:
>
> > > On Jun 15, 3:35 pm, kwan <kwan.ji...@gmail.com> wrote:
>
> > > > I used Mason for the template for my webserver, I have a very basic
> > > > knowledge for the Mason. Do everyone who have experience in template
> > > > for dynamic and complicated web site.
>
> > > > thank you
>
> > > What do you want?
> > > What are you asking?
>
> > You dont understand english?
>
> You didn't ask a question nor did you state your problem. To me it
> seemed as if you were just asking if "everyone who uses templates have
> erience for complicated dynamic websites". If so, what difference
> does it make if someone replies with a "Yes" or "No"?
Hi,
I used to design my own web server with pure Perl/CGI, however, I
realized that it is not really dynamic then I turn it to HTML::Mason,
I learn very basic of Mason, the questions is which template should I
use to make my web server easy to update and improve performance. As
there are many template in the market, I feel that Mason is good for
the dynmaic and large web site, but perhaps someone here can give more
information about a particular template that will help me to cope with
the complex web site.
Thank
------------------------------
Date: Sat, 16 Jun 2007 10:36:39 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Template
Message-Id: <RrKdnZo_2qsMjOnbnZ2dnUVZ_vmqnZ2d@comcast.com>
kwan wrote:
> perhaps someone here can give more information about a particular
> template that will help me to cope with the complex web site.
There are several templating systems available for Perl. We may not be
able to tell you which is best for your situation. HTML::Template is
certainly worth looking at.
http://search.cpan.org/~samtregar/HTML-Template-2.9/Template.pm
------------------------------
Date: Sat, 16 Jun 2007 19:57:06 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations
Message-Id: <slrnf7893i.2aq.hjp-usenet2@zeno.hjp.at>
["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-06-12 08:15, Thomas F. Burdick <tburdick@gmail.com> wrote:
> On Jun 11, 11:36 pm, Tim Bradshaw <tfb+goo...@tfeb.org> wrote:
>> On Jun 11, 8:02 am, Twisted <twisted...@gmail.com> wrote:
>>
>> > On Jun 11, 2:42 am, Joachim Durchholz <j...@durchholz.org> wrote:
>>
>> > > It is possible to write maintainable Perl.
>>
>> > Interesting (spoken in the tone of someone hearing about a purported
>> > sighting of Bigfoot, or maybe a UFO).
>>
>> I think it's just obvious that this is the case. What would *stop*
>> you writing maintainable Perl?
>
> The constantly shifting target of a language. Hell, even the parser
> has changed over time.
As with any other language I know, too (well, maybe cobol hasn't changed
in the last 10 years - I haven't looked lately).
The grammar of perl hasn't changed much since perl 5.0, which was
released in 1994. There were a few minor additions, but just about every
perl 5.0 script would still run with perl 5.8.x.
Try getting to run 13 year old C++ code with a current compiler some
time ...
> Fortunately this seems to have been solved by
> Perl 6 [*].
>
> [*] Stopping work on Perl 5 to focus on the probably never-to-be Perl
> 6 brought a surprising stability to the language.
Perl 6 started in 2000, AFAIR, when 5.005_03 was the stable release of
perl5 (with development on perl 5.6 well on the way, yes).
Maybe my memory is faulty but I don't have the impression that there was
much more change in the six years between 5.0 and and 5.005_03 than in the
seven years between 5.005 and 5.8.8 (despite everybody complaining that
perl (not Perl) is essentially unmaintable).
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: Sat, 16 Jun 2007 16:39:40 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Useless use of array element in void context
Message-Id: <f513r0.1g4.1@news.isolution.nl>
Michele Dondi schreef:
> On Tue, 12 Jun 2007 01:01:33 +0200, "Dr.Ruud"
> <rvtol+news@isolution.nl> wrote:
>
>>> Affijn:
>>
>> Heheh, "Affijn" is a Dutch variant of the French "enfin".
>
> And "enfin" for us poor (Italian and most) English speaker is... "the
> end"?
It can mean many things, depending how (tone and melody) it is said (or
written :).
at last, at the end, shortly, summarizing, oh well, still, &c &c
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 16 Jun 2007 15:26:13 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Which Perl 5 OO extension can be seen as "standard" (defacto, quasi)?
Message-Id: <k2p773l69id1iiqji6viohq54i6malj342@4ax.com>
On Fri, 15 Jun 2007 09:56:33 -0700, Jim Gibson
<jgibson@mail.arc.nasa.gov> wrote:
>> I like the very fundamental OO support of Perl 5.
>
>OO support was added in Perl 5. It didn't exist in Perl 4. That is not
>my definition of "fundamental". Perhaps you mean "primitive" :)
Yes I think so. In Italian too "fondamentale" can have an acceptation
akin to that one, and a naive translation may be the source for
possible confusion, albeit less so than with other words.
>> * how stable are those implementations?
>
>The reform.pm module looks very stable. It was uploaded to CPAN in Sep,
>2004 and not updated since.
Or obsolete... (I don't actually know, but that's possible!)
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: Sat, 16 Jun 2007 08:23:00 -0700
From: Craig <cgrady357@gmail.com>
Subject: Re: Writing row at a time in Excel using OLE
Message-Id: <1182007380.766333.246220@o61g2000hsh.googlegroups.com>
#!/C:/Perl/bin/perl.exe
use strict;
use warnings;
use DBI;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
use Win32::OLE::Variant;
$Win32::OLE::Warn = 3;
my $file = "C:\\TMP\\test.xls";
my %args = ( sample => [ 'dbi:ODBC:Sample_Access_db', "administrator",
"" ],
sql => q{SELECT product, last_name, first_name, comment FROM
sample_table;},);
my $dbh = DBI->connect(@{$args{sample}}) or die ($DBI::errstr . "
Connect string: " . join(" ", @{$args{sample}}));
my $sth = $dbh->prepare($args{sql}) or die $dbh->errstr;
$sth->execute or die $dbh->errstr;
my $aref = $sth->fetchall_arrayref();
$sth->finish();
$dbh->disconnect;
my $excel = Win32::OLE->GetActiveObject('Excel.Application') ||
Win32::OLE->new('Excel.Application', 'Quit');
my $book = $excel->Workbooks->Open($file) or die("Could not open
$file", $?, $!);
my $sheet1 = $book->Worksheets(1);
$sheet1->Range("A6:D10")->{Value} = $aref;
------------------------------
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 524
**************************************