[31719] in Perl-Users-Digest
Perl-Users Digest, Issue: 2982 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 10 03:09:27 2010
Date: Thu, 10 Jun 2010 00:09:08 -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 Thu, 10 Jun 2010 Volume: 11 Number: 2982
Today's topics:
Re: convert integer to string <hjp-usenet2@hjp.at>
Re: convert integer to string <hjp-usenet2@hjp.at>
Re: convert integer to string <cartercc@gmail.com>
Converting HTML to PDF with Webkit (was: suggestions <hjp-usenet2@hjp.at>
Re: Converting HTML to PDF with Webkit (was: suggest <apeiron@invalid.isuckatdomains.net>
Re: graphics <willem@turtle.stack.nl>
Re: graphics <smallpond@juno.com>
Re: graphics <nospam-abuse@ilyaz.org>
Re: graphics <john@castleamber.com>
Re: How to get the class name from the reference to an (Jens Thoms Toerring)
Re: ignoring namespaces? <peter.nosp@m.silmaril.ie>
Is there a way to search all the perl document? <pengyu.ut@gmail.com>
Re: Is there a way to search all the perl document? <xhoster@gmail.com>
Re: Is there a way to search all the perl document? <tadmc@seesig.invalid>
Re: Official Behavior of $str =~ $pattern <himanshu.garg@gmail.com>
Re: Why does perl allow so many different ways of doing <pengyu.ut@gmail.com>
Re: Why does perl allow so many different ways of doing <smallpond@juno.com>
Re: Why does perl allow so many different ways of doing <xhoster@gmail.com>
Re: Why does perl allow so many different ways of doing <xhoster@gmail.com>
Re: Why does perl allow so many different ways of doing <tadmc@seesig.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 9 Jun 2010 22:00:41 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: convert integer to string
Message-Id: <slrni0vsn9.dfn.hjp-usenet2@hrunkner.hjp.at>
On 2010-06-08 21:12, ccc31807 <cartercc@gmail.com> wrote:
> #! perl
> # array.plx
> use strict;
> use warnings;
> my %presidents;
> while (<DATA>)
> {
> chomp;
> my ($order, $first, $last, @years) = split /\|/;
> $presidents{$order} = {
> first => $first,
> last => $last,
> years => @years,
> };
> }
>
> foreach my $k (sort keys %presidents)
> {
> print "$k => $presidents{$k}\n";
> foreach my $k2 (sort keys %{$presidents{$k}})
> {
> print " $k2 => $presidents{$k}{$k2}\n";
> }
> }
> exit(0);
This script never pads $order to two digits.
> __DATA__
> 1|George|Washington|1788 1792
^ here $order has only one digit.
> 2|John|Adams|1796
> 3|Thomas|Jefferson|1800 1804
> 4|James|Madison|1808 1812
> 32|Franklin|Roosevelt|1932 1936 1940 1944
>
> ----------OUTPUT----------------
> D:\PerlLearn>perl array.plx
> 01 => HASH(0x248e5c)
^^ Thus I do not believe that this output is from the script above.
hp
------------------------------
Date: Wed, 9 Jun 2010 22:01:46 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: convert integer to string
Message-Id: <slrni0vspa.dfn.hjp-usenet2@hrunkner.hjp.at>
On 2010-06-08 18:26, Uri Guttman <uri@StemSystems.com> wrote:
>>>>>> "c" == ccc31807 <cartercc@gmail.com> writes:
> c> 0123456 => HASH(deadbeed)
> c> id => 0123456
>
> that is an OCTAL literal.
It isn't a literal at all. It's a string read from a file.
hp
------------------------------
Date: Wed, 9 Jun 2010 13:49:21 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: convert integer to string
Message-Id: <0da173c9-dae2-493c-a127-795738fa3acd@35g2000vbj.googlegroups.com>
On Jun 9, 4:00=A0pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
> On 2010-06-08 21:12, ccc31807 <carte...@gmail.com> wrote:
>
>
>
> > #! perl
> > # array.plx
> > use strict;
> > use warnings;
> > my %presidents;
> > while (<DATA>)
> > {
> > =A0 =A0chomp;
> > =A0 =A0my ($order, $first, $last, @years) =3D split /\|/;
> > =A0 =A0$presidents{$order} =3D {
> > =A0 =A0 =A0 =A0 =A0 =A0first =3D> $first,
> > =A0 =A0 =A0 =A0 =A0 =A0last =3D> $last,
> > =A0 =A0 =A0 =A0 =A0 =A0years =3D> @years,
> > =A0 =A0};
> > }
>
> > foreach my $k (sort keys %presidents)
> > {
> > =A0 =A0print "$k =3D> $presidents{$k}\n";
> > =A0 =A0foreach my $k2 (sort keys %{$presidents{$k}})
> > =A0 =A0{
> > =A0 =A0 =A0 =A0 =A0 =A0print " =A0 $k2 =3D> $presidents{$k}{$k2}\n";
> > =A0 =A0}
> > }
> > exit(0);
>
> This script never pads $order to two digits.
>
> > __DATA__
> > 1|George|Washington|1788 1792
>
> =A0 ^ here $order has only one digit.> 2|John|Adams|1796
> > 3|Thomas|Jefferson|1800 1804
> > 4|James|Madison|1808 1812
> > 32|Franklin|Roosevelt|1932 1936 1940 1944
>
> > ----------OUTPUT----------------
> > D:\PerlLearn>perl array.plx
> > 01 =3D> HASH(0x248e5c)
>
> =A0 ^^ Thus I do not believe that this output is from the script above.
>
> =A0 =A0 =A0 =A0 hp
You are correct. I had copied the script from a previous run and was
playing with the order. The output is from a change in the DATA with
the keys like 01. If you run the script, it produces 1,2, 3, 32, 4.
CC.
------------------------------
Date: Wed, 9 Jun 2010 21:49:54 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Converting HTML to PDF with Webkit (was: suggestions for printing out a few records of a lengthy file)
Message-Id: <slrni0vs32.dfn.hjp-usenet2@hrunkner.hjp.at>
On 2010-06-08 07:57, Dr.Ruud <rvtol+usenet@xs4all.nl> wrote:
> On the related subject of creating nice PDFs:
> we are using webkit for that for the last few years,
> we create many-many thousands a day,
> and we are very happy with the results.
Sounds interesting. Which perl module do you use (there are several on
CPAN, but the descriptions don't look promising)?
hp
------------------------------
Date: Thu, 10 Jun 2010 07:02:20 +0000 (UTC)
From: Chris Nehren <apeiron@invalid.isuckatdomains.net>
Subject: Re: Converting HTML to PDF with Webkit (was: suggestions for printing out a few records of a lengthy file)
Message-Id: <slrni113ft.2qe4.apeiron+usenet@eschaton.local>
On 2010-06-09, Peter J. Holzer scribbled these
curious markings:
> On 2010-06-08 07:57, Dr.Ruud <rvtol+usenet@xs4all.nl> wrote:
>> On the related subject of creating nice PDFs:
>> we are using webkit for that for the last few years,
>> we create many-many thousands a day,
>> and we are very happy with the results.
>
> Sounds interesting. Which perl module do you use (there are several on
> CPAN, but the descriptions don't look promising)?
Not a module, per se, but I've had success with wkhtmltopdf. See
http://code.google.com/p/wkhtmltopdf/ for more info.
--
Thanks and best Regards,
Chris Nehren
------------------------------
Date: Wed, 9 Jun 2010 18:18:05 +0000 (UTC)
From: Willem <willem@turtle.stack.nl>
Subject: Re: graphics
Message-Id: <slrni0vmmt.pb8.willem@turtle.stack.nl>
Huub wrote:
) I use DBI to get the data from the database, after which it is printed as
) pure plain text. So I'm not converting anything to XML, HTML, pdf or so.
) This has worked for some years now, and no problem.
)
) And my initial question was if there is a Perl module that enables me to
) print both a jpg image and the data from the database in 1 single
) printjob. But if I understood it correctly, the Graphics modules are
) intended to create a graphical image, rather than to fetch one for e.g.
) printing on paper.
Yes, you want a printing module for that, not a graphics module.
For example, on Win32 you have stuff like Win32::Printer, which can
print several image formats, according to the docs.
Or you could generate HTML or XSL-FO or something with the text
and the graphics you want, and then print that.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
------------------------------
Date: Wed, 09 Jun 2010 15:48:02 -0400
From: Steve C <smallpond@juno.com>
Subject: Re: graphics
Message-Id: <huor61$h8v$1@news.eternal-september.org>
Huub wrote:
> Hi,
>
> I'm using Perl to print from database, which works great. Now I'd like to
> print a .JPG picture with it. However, searching CPAN I find a LOT of
> graphics modules. Any recommendation which one to use for this?
>
The intermediate form between binary data and a printer is a
page description language. ASCII is the original text-only PDL,
but you can't use it for anything more complex.
Good choices for page description with images are postscript, pdf,
or pcl, all of which can be generated from perl. HTML works too if
value ease over precision. It just depends on your printing
environment.
------------------------------
Date: Thu, 10 Jun 2010 02:08:28 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: graphics
Message-Id: <slrni10i8s.jt8.nospam-abuse@powdermilk.math.berkeley.edu>
On 2010-06-09, RedGrittyBrick <RedGrittyBrick@spamweary.invalid> wrote:
> I'd have the Perl program write a Postscript file containing image data
> and text, then use OS-dependant commands to spool that to a Postscript
> printer or via a Postscript aware print subsystem like CUPS or
> Ghostscript. Your mileage is likely to vary. CPAN is your friend.
Nowadays it looks like PostScript would be the last choice...
Generating PDF might be easy (did not try it), and it is much easier
to print...
Myself, I would go through enscript or TeX - this would cover the
typesetting needs (instead of trying to reinvent things in Perl).
Hope this helps,
Ilya
------------------------------
Date: Thu, 10 Jun 2010 01:08:56 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: graphics
Message-Id: <87ocfjpgg7.fsf@castleamber.com>
Ilya Zakharevich <nospam-abuse@ilyaz.org> writes:
> On 2010-06-09, RedGrittyBrick <RedGrittyBrick@spamweary.invalid> wrote:
>> I'd have the Perl program write a Postscript file containing image data
>> and text, then use OS-dependant commands to spool that to a Postscript
>> printer or via a Postscript aware print subsystem like CUPS or
>> Ghostscript. Your mileage is likely to vary. CPAN is your friend.
>
> Nowadays it looks like PostScript would be the last choice...
> Generating PDF might be easy (did not try it), and it is much easier
> to print...
>
> Myself, I would go through enscript or TeX - this would cover the
> typesetting needs (instead of trying to reinvent things in Perl).
>
> Hope this helps,
> Ilya
Over a year ago I played with lout:
http://en.wikipedia.org/wiki/Lout_%28software%29
Maybe also something to look into?
--
John Bokma j3b
Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development
------------------------------
Date: 9 Jun 2010 22:27:51 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: How to get the class name from the reference to an object?
Message-Id: <87air7F5hkU1@mid.uni-berlin.de>
chad <cdalten@gmail.com> wrote:
> On Jun 6, 3:35 pm, j...@toerring.de (Jens Thoms Toerring) wrote:
> > Peng Yu <pengyu...@gmail.com> wrote:
> > > Suppose I new an object. Is there a way to get the class name from the
> > > reference to the object?
> >
> > The ref() function should return the name of the package of the
> > object - I guess that's what you mean by "class name".
> Is there more than one defintion to "class name"?
Well, in Perl I'm more used to the term "package" (and ref()
returns the "package name" for blessed objects according to
the documentation) than "class" - thus I was not 100% sure
what the OP wanted...
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
------------------------------
Date: Wed, 09 Jun 2010 22:02:32 +0100
From: Peter Flynn <peter.nosp@m.silmaril.ie>
Subject: Re: ignoring namespaces?
Message-Id: <87adraFk0qU1@mid.individual.net>
sln@netherlands.com wrote:
> On Mon, 07 Jun 2010 12:32:15 +0100, Peter Flynn <peter.nosp@m.silmaril.ie> wrote:
[...]
>> I always counsel to avoid the non-XML approach
[...]
> This might parse it (with a slight bit of validation)
It occurs to me that you can combine both methods, iff the document is
well-formed.
Run onsgmls -wxml /usr/share/xml/declaration/xml.dcl doc.xml >doc.esis
to get the ESIS, and then tweak the W3C's esis2xml.py script to re-form
the XML document, omitting the namespaces. Or write your own in Perl...
///Peter
------------------------------
Date: Wed, 9 Jun 2010 20:15:44 -0700 (PDT)
From: Peng Yu <pengyu.ut@gmail.com>
Subject: Is there a way to search all the perl document?
Message-Id: <d90bfa74-1a3c-43a4-a0ab-bcc56b917dfb@c10g2000yqi.googlegroups.com>
Suppose I'm looking for the explanation of __END__, but I'm not sure
which man page I should look at. perldoc __END__ returns the following
error.
No documentation found for "__END__".
The dumbest way is to go through each manpage manually. But I'd like
to know if there is a command to automatically search which manpage
has the word "__END__".
------------------------------
Date: Wed, 09 Jun 2010 21:18:02 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Is there a way to search all the perl document?
Message-Id: <4c1067a7$0$26757$ed362ca5@nr5-q3a.newsreader.com>
Peng Yu wrote:
> Suppose I'm looking for the explanation of __END__, but I'm not sure
> which man page I should look at. perldoc __END__ returns the following
> error.
>
> No documentation found for "__END__".
>
> The dumbest way is to go through each manpage manually. But I'd like
> to know if there is a command to automatically search which manpage
> has the word "__END__".
It is documented in perldata. I'm not really sure why, that doesn't
strike me as the most logical place. I know this because several years
ago I asked about it here and someone told me.
Sorry, I can't answer your real question.
Xho
------------------------------
Date: Thu, 10 Jun 2010 00:20:19 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Is there a way to search all the perl document?
Message-Id: <slrni10t5b.qp5.tadmc@tadbox.sbcglobal.net>
Peng Yu <pengyu.ut@gmail.com> wrote:
> Suppose I'm looking for the explanation of __END__, but I'm not sure
> which man page I should look at. perldoc __END__ returns the following
> error.
>
> No documentation found for "__END__".
>
> The dumbest way is to go through each manpage manually. But I'd like
> to know if there is a command to automatically search which manpage
> has the word "__END__".
If only there was a handy general purpose programming language
around, then we could write a program to automatically search which
manpage has a given term...
----------------------------
#!/usr/bin/perl
use warnings;
use strict;
my $heads;
if (@ARGV and $ARGV[0] eq '-h') {
shift;
$heads = 1;
}
die "USAGE: pod_grep [-h] <term>\n" unless @ARGV == 1;
my $term = shift;
my $pat = `perldoc -l perlfunc`;
chomp $pat;
$pat =~ s/perlfunc/*/;
@ARGV = glob $pat;
# @ARGV = grep !/(delta|toc)\.pod$/, glob $pat; # eliminate "noise"
while (<>) {
if ($heads)
{ next unless /^=/ }
print "$ARGV: $_" if /\Q$term/;
}
----------------------------
pod_grep __END__
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
Date: Wed, 9 Jun 2010 13:38:43 -0700 (PDT)
From: "++imanshu" <himanshu.garg@gmail.com>
Subject: Re: Official Behavior of $str =~ $pattern
Message-Id: <93ededf0-26c9-47a8-b1ef-9820ef01809f@a2g2000prd.googlegroups.com>
On Jun 9, 2:53=A0pm, Peter Makholm <pe...@makholm.net> wrote:
> "++imanshu" <himanshu.g...@gmail.com> writes:
> > The snippet above prints 'hello, world' even though the RHS of =3D~
> > isn't inside // or m{}.
>
> > I have some legacy code which does a lot of this. Could you point me
> > to the official behaviour of such expressions in RHS, please.
>
> It is documented in 'perldoc perlop' look for the paragraph named
> 'Binding Operators':
>
> =A0 If the right argument is an expression rather than a search pattern,
> =A0 substitution, or transliteration, it is interpreted as a search
> =A0 pattern at run time. Note that this means that its contents will be
> =A0 interpolated twice, [...]
>
> //Makholm
Sorry, missed that one. Just what I was looking for.
Thank You,
Himanshu
------------------------------
Date: Wed, 9 Jun 2010 19:59:17 -0700 (PDT)
From: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: Why does perl allow so many different ways of doing essentially the same thing?
Message-Id: <c0afb2f1-4d26-426b-a7f7-37fc272caaa9@d37g2000yqm.googlegroups.com>
On Jun 9, 12:18=A0pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
> >>>>> "PY" =3D=3D Peng Yu <pengyu...@gmail.com> writes:
>
> =A0 =A0 PY> But I doubt that having multiple ways of doing the same thing
> =A0 =A0 PY> really give us any advantages over other languages.
>
> The culture in which Perl has developed for the past couple of decades
> embraces "TIMTOWTDI" - "there is more than one way to do it." =A0See the
> entry in the glossary of Programming Perl, 3rd ed., on page 1005.
>
> Other languages' cultures prefer that there be one correct way to do
> things; if that's what you prefer, then you'll probably be happier with
> another language.
According to Programming Perl, more than one way may not always be
better. But I just don't see more than one way is better at all.
I think that any code can be encapsulated in a subroutine or a class.
To the end user, the actually implementation doesn't matter. It is the
interface that matters. There should be just one unique interface to
do the same task.
In this sense, there were a subroutine that can read multiple lines
from a file. There is no need that the users should understand the
different ways of reading muliple lines as discussed in other thread
mentioned the original post.
To me, if there were enough encapsulate in perl, there is no need of
TIMTOWTDI at least i the interface level.
------------------------------
Date: Wed, 09 Jun 2010 15:54:24 -0400
From: Steve C <smallpond@juno.com>
Subject: Re: Why does perl allow so many different ways of doing essentially the same thing?
Message-Id: <huori0$k1d$1@news.eternal-september.org>
Peng Yu wrote:
> The following thread shows many ways of reading a given number of
> lines.
>
> http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/478db847f15ce016/fe47580f819866cb?lnk=gst&q=pengyu.ut#fe47580f819866cb
>
> But I doubt that having multiple ways of doing the same thing really
> give us any advantages over other languages. Essentially this can be
> encapsulate in a subroutine, which is easy for refactoring and code
> transformation.
>
> Although, there might be advantages in other scenario to have multiple
> ways of doing the same thing. But I don't think it is the case for the
> particular question.
>
> I know some justification that people could choose whatever style they
> want if there are multiple ways of doing the same thing. But this
> justification is not convincing to me, considering that it may cause
> the code not readable and cause many maintenance issues.
>
> Is there any study with concrete data demonstrates how this multiple-
> way-of-doing-the-same-thing philosophy actually can help programmer
> improve productivity?
>
Suppose in one case you need to read exactly four lines, and in a different
case you need to read 100 million lines. Would you want to use a
language that required you to do both the same way?
There are multiple ways to do any interesting programming task in every
language. It's not a weakness and it isn't just about productivity.
It's more about flexibility.
------------------------------
Date: Wed, 09 Jun 2010 19:54:30 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Why does perl allow so many different ways of doing essentially the same thing?
Message-Id: <4c1065b4$0$26778$ed362ca5@nr5-q3a.newsreader.com>
Peng Yu wrote:
> The following thread shows many ways of reading a given number of
> lines.
>
> http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/478db847f15ce016/fe47580f819866cb?lnk=gst&q=pengyu.ut#fe47580f819866cb
>
> But I doubt that having multiple ways of doing the same thing really
> give us any advantages over other languages.
You seem to be implying that other languages don't have multiple ways of
doing the same thing.
> Essentially this can be
> encapsulate in a subroutine, which is easy for refactoring and code
> transformation.
Sure. We can make a subroutine read_3_lines, and use that subroutine
whenever we need to read three lines. But now, one of the places that
used that subroutine now needs to read 4 lines. Do we change the
subroutine read_3_lines so that it now reads 4 lines, or do we create a
new subroutine named read_4_lines? Should we also have subroutines
names add_1, add_2, add_3, multiple_by_2, multiply_by_3, etc.?
> Although, there might be advantages in other scenario to have multiple
> ways of doing the same thing. But I don't think it is the case for the
> particular question.
Well then do don't use do it in multiple ways for that particular
question. Geez.
> I know some justification that people could choose whatever style they
> want if there are multiple ways of doing the same thing. But this
> justification is not convincing to me, considering that it may cause
> the code not readable and cause many maintenance issues.
Perhaps you aren't cut out for Perl.
> Is there any study with concrete data demonstrates how this multiple-
> way-of-doing-the-same-thing philosophy actually can help programmer
> improve productivity?
No, we are far too busy being productive to bother with wankery like that.
Xho
------------------------------
Date: Wed, 09 Jun 2010 21:19:33 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Why does perl allow so many different ways of doing essentially the same thing?
Message-Id: <4c1067a9$0$26751$ed362ca5@nr5-q3a.newsreader.com>
Peng Yu wrote:
> On Jun 9, 12:18 pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
>>>>>>> "PY" == Peng Yu <pengyu...@gmail.com> writes:
>> PY> But I doubt that having multiple ways of doing the same thing
>> PY> really give us any advantages over other languages.
>>
>> The culture in which Perl has developed for the past couple of decades
>> embraces "TIMTOWTDI" - "there is more than one way to do it." See the
>> entry in the glossary of Programming Perl, 3rd ed., on page 1005.
>>
>> Other languages' cultures prefer that there be one correct way to do
>> things; if that's what you prefer, then you'll probably be happier with
>> another language.
>
> According to Programming Perl, more than one way may not always be
> better. But I just don't see more than one way is better at all.
>
> I think that any code can be encapsulated in a subroutine or a class.
> To the end user, the actually implementation doesn't matter. It is the
> interface that matters. There should be just one unique interface to
> do the same task.
Weren't you recently complaining that you needed to encapsulate your own
selection without replacement, and Perl should just do it for you
automatically?
Xho
------------------------------
Date: Thu, 10 Jun 2010 00:28:27 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Why does perl allow so many different ways of doing essentially the same thing?
Message-Id: <slrni10tkk.qp5.tadmc@tadbox.sbcglobal.net>
Peng Yu <pengyu.ut@gmail.com> wrote:
> On Jun 9, 12:18 pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
>> >>>>> "PY" == Peng Yu <pengyu...@gmail.com> writes:
>>
>> PY> But I doubt that having multiple ways of doing the same thing
>> PY> really give us any advantages over other languages.
>>
>> The culture in which Perl has developed for the past couple of decades
>> embraces "TIMTOWTDI" - "there is more than one way to do it." See the
>> entry in the glossary of Programming Perl, 3rd ed., on page 1005.
>>
>> Other languages' cultures prefer that there be one correct way to do
>> things; if that's what you prefer, then you'll probably be happier with
>> another language.
>
> According to Programming Perl, more than one way may not always be
> better. But I just don't see more than one way is better at all.
If there is Only One Way to say, print a certain number of lines
from a file, then you cannot proceed until you have found
that One Way.
If there are multiple ways, then you only have to find any one of them,
and you can then proceed with your real job.
Which is better searching for a needle in a haystack or searching
for any of a bunch of needles in a haystack?
See also:
http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/2f1ca39cbbc86cc6/ff1a79653c5564c7?q=#ff1a79653c5564c7
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
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 2982
***************************************