[33070] in Perl-Users-Digest
Perl-Users Digest, Issue: 4346 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 9 14:09:20 2015
Date: Fri, 9 Jan 2015 11:09:03 -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, 9 Jan 2015 Volume: 11 Number: 4346
Today's topics:
Re: Twelve Drummers Drumming <gravitalsun@hotmail.foo>
Re: Twelve Drummers Drumming <gravitalsun@hotmail.foo>
Re: Twelve Drummers Drumming <rweikusat@mobileactivedefense.com>
Re: Twelve Drummers Drumming <tzz@lifelogs.com>
Re: Twelve Drummers Drumming <gravitalsun@hotmail.foo>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 09 Jan 2015 18:45:06 +0200
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: Twelve Drummers Drumming
Message-Id: <m8p0ij$lnp$1@mouse.otenet.gr>
On 8/1/2015 17:57, Ted Zlatanov wrote:
> use Lingua::EN::Inflect qw( NUMWORDS ORD );
>
> say ORD(NUMWORDS($_)) for 1..12;
# ok lets put it together !
#! /usr/bin/perl
use feature qw/say/;
use Lingua::EN::Inflect qw(NUMWORDS ORD);
my @Gift=(
"a partridge in a pear tree.\n",
"two turtle doves,\nand ",
"three French hens, ",
"four calling birds, ",
"five golden rings,\n",
"six geese a-laying, ",
"seven swans a-swimming,\n",
"eight maids a-milking, ",
"nine ladies dancing, ",
"ten lords a leaping,\n",
"eleven pipers piping, ",
"twelve drummers drumming, ");
for (1..@Gift) { say
"On the ", ORD(NUMWORDS $_),
" day of Christmas my true love gave to me
@Gift[reverse 0..$_-1]" }
say "
Cheers,
Robbie Hatley
Midway City, CA, USA
\154o\156e\167o\154f\100w\145ll\56c\157m";
------------------------------
Date: Fri, 09 Jan 2015 18:58:21 +0200
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: Twelve Drummers Drumming
Message-Id: <m8p1bd$m47$1@mouse.otenet.gr>
# or better
#! /usr/bin/perl
use Lingua::EN::Inflect qw(NUMWORDS ORD);
my @Gift=(
"a partridge in a pear tree.\n",
"two turtle doves,\nand ",
"three French hens, ",
"four calling birds, ",
"five golden rings,\n",
"six geese a-laying, ",
"seven swans a-swimming,\n",
"eight maids a-milking, ",
"nine ladies dancing, ",
"ten lords a leaping,\n",
"eleven pipers piping, ",
"twelve drummers drumming, ");
print "On the ",ORD(NUMWORDS $_),
" day of Christmas my true love gave to me
@Gift[reverse 0..$_-1]\n" for 1..@Gift;
print "Cheers,\nRobbie Hatley\nMidway City, CA, USA
\154o\156e\167o\154f\100w\145ll\56c\157m";
------------------------------
Date: Fri, 09 Jan 2015 17:11:44 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Twelve Drummers Drumming
Message-Id: <87twzzswtr.fsf@doppelsaurus.mobileactivedefense.com>
George Mpouras <gravitalsun@hotmail.foo> writes:
> On 8/1/2015 17:57, Ted Zlatanov wrote:
>> use Lingua::EN::Inflect qw( NUMWORDS ORD );
>>
>> say ORD(NUMWORDS($_)) for 1..12;
>
>
> # ok lets put it together !
>
> #! /usr/bin/perl
> use feature qw/say/;
> use Lingua::EN::Inflect qw(NUMWORDS ORD);
>
> my @Gift=(
> "a partridge in a pear tree.\n",
> "two turtle doves,\nand ",
> "three French hens, ",
> "four calling birds, ",
> "five golden rings,\n",
> "six geese a-laying, ",
> "seven swans a-swimming,\n",
> "eight maids a-milking, ",
> "nine ladies dancing, ",
> "ten lords a leaping,\n",
> "eleven pipers piping, ",
> "twelve drummers drumming, ");
>
> for (1..@Gift) { say
> "On the ", ORD(NUMWORDS $_),
> " day of Christmas my true love gave to me
> @Gift[reverse 0..$_-1]" }
You've now successfully replaced a single line of code with 1,273 lines
of code most of which have no relation to the problem at hand whatsoever
...
------------------------------
Date: Fri, 09 Jan 2015 13:28:41 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Twelve Drummers Drumming
Message-Id: <87wq4volk6.fsf@lifelogs.com>
On Fri, 09 Jan 2015 17:11:44 +0000 Rainer Weikusat <rweikusat@mobileactivedefense.com> wrote:
RW> George Mpouras <gravitalsun@hotmail.foo> writes:
>> On 8/1/2015 17:57, Ted Zlatanov wrote:
>>> use Lingua::EN::Inflect qw( NUMWORDS ORD );
>>>
>>> say ORD(NUMWORDS($_)) for 1..12;
>> for (1..@Gift) { say
>> "On the ", ORD(NUMWORDS $_),
>> " day of Christmas my true love gave to me
>> @Gift[reverse 0..$_-1]" }
RW> You've now successfully replaced a single line of code with 1,273 lines
RW> of code most of which have no relation to the problem at hand whatsoever
I think you mean "one thousand, two hundred and seventy-three"[1]
HTH
Ted
[1] perl -MLingua::EN::Inflect=NUMWORDS -e'print scalar NUMWORDS(1273)'
------------------------------
Date: Fri, 09 Jan 2015 20:38:01 +0200
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: Twelve Drummers Drumming
Message-Id: <m8p769$o6q$1@mouse.otenet.gr>
>
> You've now successfully replaced a single line of code with 1,273 lines
> of code most of which have no relation to the problem at hand whatsoever
> ...
>
do you count the risc cpu commands also ; )
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 4346
***************************************