[31722] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2985 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 11 14:09:26 2010

Date: Fri, 11 Jun 2010 11: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           Fri, 11 Jun 2010     Volume: 11 Number: 2985

Today's topics:
    Re: access to files in multiple combinations of folders <jurgenex@hotmail.com>
    Re: access to files in multiple combinations of folders <geoff@invalid.invalid>
        binmode for readling the whole file? <pengyu.ut@gmail.com>
    Re: binmode for readling the whole file? <tadmc@seesig.invalid>
    Re: binmode for readling the whole file? <pengyu.ut@gmail.com>
    Re: binmode for readling the whole file? <tadmc@seesig.invalid>
    Re: binmode for readling the whole file? <john@castleamber.com>
    Re: graphics <tzz@lifelogs.com>
    Re: Why does perl allow so many different ways of doing <tzz@lifelogs.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 <cartercc@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 (hymie!)
    Re: Why does perl allow so many different ways of doing <cartercc@gmail.com>
    Re: Why does perl allow so many different ways of doing <bugbear@trim_papermule.co.uk_trim>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 11 Jun 2010 04:34:53 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: access to files in multiple combinations of folders?
Message-Id: <np7416pllq388sq4rrvjhifffpc50fse9h@4ax.com>

Geoff <geoff@invalid.invalid> wrote:
>I would like website users to be able to have access to the files in
>any combination of folders.
>
>Say there are 20 folders, each with different files in them. User A
>needs access to files in folders 1, 2 and 3, user B access to files in
>folders 7, 10, 15 and 20 and so on.
>
>Now I know I can have a .htaccess file in each folder but that would
>mean giving user A three different user name and password
>combinations, user B four different combinations.

Do you have a question that is related to Perl, too?

jue


------------------------------

Date: Fri, 11 Jun 2010 18:15:16 +0100
From: Geoff <geoff@invalid.invalid>
Subject: Re: access to files in multiple combinations of folders?
Message-Id: <bnr4169b62gdtbhbc7merc1dl7ir12j3i6@4ax.com>

On Fri, 11 Jun 2010 04:34:53 -0700, Jürgen Exner
<jurgenex@hotmail.com> wrote:

>Geoff <geoff@invalid.invalid> wrote:
>>I would like website users to be able to have access to the files in
>>any combination of folders.
>>
>>Say there are 20 folders, each with different files in them. User A
>>needs access to files in folders 1, 2 and 3, user B access to files in
>>folders 7, 10, 15 and 20 and so on.
>>
>>Now I know I can have a .htaccess file in each folder but that would
>>mean giving user A three different user name and password
>>combinations, user B four different combinations.
>
>Do you have a question that is related to Perl, too?

yes, in the sense that I am looking for an alternative to the use of
 .htaccess, and this could be Perl. PHP or Javascript.

Cheers

Geoff

>
>jue


------------------------------

Date: Fri, 11 Jun 2010 03:43:48 -0700 (PDT)
From: Peng Yu <pengyu.ut@gmail.com>
Subject: binmode for readling the whole file?
Message-Id: <e3606f2c-1efe-40bb-84b5-6e39434b6d9d@c10g2000yqi.googlegroups.com>

To read a whole file into a string. The following webpage uses
binmode.

http://www.perlmonks.org/?node_id=1952

But the following code from perlvar doesn't. I tried both on linux.
They are identically. But if I want the raw data in the file, I should
always use binmode to be safe across all OS, right?

           open my $fh, "<", "foo" or die $!;
           local $/; # enable localized slurp mode
           my $content = <$fh>;
           close $fh;


------------------------------

Date: Fri, 11 Jun 2010 07:54:46 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: binmode for readling the whole file?
Message-Id: <slrni14c5l.2pg.tadmc@tadbox.sbcglobal.net>

Peng Yu <pengyu.ut@gmail.com> wrote:
> To read a whole file into a string. The following webpage uses
> binmode.
>
> http://www.perlmonks.org/?node_id=1952
>
> But the following code from perlvar doesn't. I tried both on linux.
> They are identically. But if I want the raw data in the file, I should
> always use binmode to be safe across all OS, right?
>
>            open my $fh, "<", "foo" or die $!;
>            local $/; # enable localized slurp mode
>            my $content = <$fh>;
>            close $fh;


The issue regarding whether or not to use binmode has nothing to
do with how much of the file you plan to read, either full or partial.

This issue is as described in the documentation for binmode:

     For the sake of portability it is a good idea to always use it 
     when appropriate, and to never use it when it isn't appropriate.
     ...
     In other words: regardless of platform, use binmode() on binary
     data, like for example images.

It is the *contents* of the file that dictate whether or not
binmode() should be used.


-- 
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: Fri, 11 Jun 2010 08:10:28 -0700 (PDT)
From: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: binmode for readling the whole file?
Message-Id: <ec95a23f-7c5e-4f31-9690-bccc2f29de73@i31g2000yqm.googlegroups.com>

On Jun 11, 7:54=A0am, Tad McClellan <ta...@seesig.invalid> wrote:
> Peng Yu <pengyu...@gmail.com> wrote:
> > To read a whole file into a string. The following webpage uses
> > binmode.
>
> >http://www.perlmonks.org/?node_id=3D1952
>
> > But the following code from perlvar doesn't. I tried both on linux.
> > They are identically. But if I want the raw data in the file, I should
> > always use binmode to be safe across all OS, right?
>
> > =A0 =A0 =A0 =A0 =A0 =A0open my $fh, "<", "foo" or die $!;
> > =A0 =A0 =A0 =A0 =A0 =A0local $/; # enable localized slurp mode
> > =A0 =A0 =A0 =A0 =A0 =A0my $content =3D <$fh>;
> > =A0 =A0 =A0 =A0 =A0 =A0close $fh;
>
> The issue regarding whether or not to use binmode has nothing to
> do with how much of the file you plan to read, either full or partial.
>
> This issue is as described in the documentation for binmode:
>
> =A0 =A0 =A0For the sake of portability it is a good idea to always use it
> =A0 =A0 =A0when appropriate, and to never use it when it isn't appropriat=
e.
> =A0 =A0 =A0...
> =A0 =A0 =A0In other words: regardless of platform, use binmode() on binar=
y
> =A0 =A0 =A0data, like for example images.
>
> It is the *contents* of the file that dictate whether or not
> binmode() should be used.

I had read the document. But I don't what 'appropriate' means. Does it
mean that I can not use binmode for text files?

My understand is that in linux, it doesn't matter whether binmode is
used or not for text files. But windows, binmode should not be used
for text files, because of the conversion of the CR and LF character.
Is my understand correct?


------------------------------

Date: Fri, 11 Jun 2010 10:17:34 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: binmode for readling the whole file?
Message-Id: <slrni14khd.3ei.tadmc@tadbox.sbcglobal.net>

Peng Yu <pengyu.ut@gmail.com> wrote:
> On Jun 11, 7:54 am, Tad McClellan <ta...@seesig.invalid> wrote:
>> Peng Yu <pengyu...@gmail.com> wrote:
>> > To read a whole file into a string. The following webpage uses
>> > binmode.
>>
>> >http://www.perlmonks.org/?node_id=1952
>>
>> > But the following code from perlvar doesn't. I tried both on linux.
>> > They are identically. But if I want the raw data in the file, I should
>> > always use binmode to be safe across all OS, right?
>>
>> >            open my $fh, "<", "foo" or die $!;
>> >            local $/; # enable localized slurp mode
>> >            my $content = <$fh>;
>> >            close $fh;
>>
>> The issue regarding whether or not to use binmode has nothing to
>> do with how much of the file you plan to read, either full or partial.
>>
>> This issue is as described in the documentation for binmode:
>>
>>      For the sake of portability it is a good idea to always use it
>>      when appropriate, and to never use it when it isn't appropriate.
>>      ...
>>      In other words: regardless of platform, use binmode() on binary
>>      data, like for example images.
>>
>> It is the *contents* of the file that dictate whether or not
>> binmode() should be used.
>
> I had read the document. But I don't what 'appropriate' means. 


Use binmode on binary files.

Do not use binmode on text files.

(regardless of platform)


> Does it
> mean that I can not use binmode for text files?


You can, but you probably don't want to.  :-)

So, you should not use binmode on text files.


> My understand is that in linux, it doesn't matter whether binmode is
> used or not for text files. But windows, binmode should not be used
> for text files, because of the conversion of the CR and LF character.
> Is my understand correct?


Yes.


-- 
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: Fri, 11 Jun 2010 12:48:17 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: binmode for readling the whole file?
Message-Id: <87fx0tcvfi.fsf@castleamber.com>

Tad McClellan <tadmc@seesig.invalid> writes:

> Use binmode on binary files.
>
> Do not use binmode on text files.

/unless/ you want the data as it is on disk, for example to
calculate a check sum.

Another reason to use binmode might be if some code has opened the file
for you and you want to use a different layer, e.g.

binmode $fh, ':utf8';

-- 
John Bokma                                                               j3b

Hacking & Hiking in Mexico -  http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development


------------------------------

Date: Fri, 11 Jun 2010 12:19:42 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: graphics
Message-Id: <87ocfh1o7l.fsf@lifelogs.com>

On Thu, 10 Jun 2010 22:37:56 +0200 Mart van de Wege <mvdwege@mail.com> wrote: 

MvdW> I used SVG::TT:Graph to generate the graphs, Image::Magick to
MvdW> convert them to PNG, Template Toolkit to build LaTex files
MvdW> referring to the images, and LaTeX::Driver to render the LaTeX to
MvdW> PDF.

MvdW> Works like a charm, even if the toolchain is long. LaTeX::Driver is a
MvdW> bit finicky if you don't clean up your working directory though.

Any chance you can publish your toolchain to convert a series of PNG
files to a PDF file?

Thanks
Ted


------------------------------

Date: Fri, 11 Jun 2010 12:16:23 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Why does perl allow so many different ways of doing essentially  the same thing?
Message-Id: <87sk4t1od4.fsf@lifelogs.com>

On Fri, 11 Jun 2010 03:11:36 -0700 (PDT) Peng Yu <pengyu.ut@gmail.com> wrote: 

PY> On Jun 10, 8:32 am, Ted Zlatanov <t...@lifelogs.com> wrote:

>> I think Peng Yu is asking for something like List::Utils but more
>> general.  It's not a terrible idea; Simple::Perl (analogous to
>> Modern::Perl) could be useful to beginners and could even be a way to
>> teach efficient Perl (through an option to show the generated code).  It
>> would certainly be better than a DSL.  Another parallel is the Template
>> Toolkit, which has lots of primitives that make writing raw Perl less
>> necessary.

PY> Yes. Essentially this is what I'm asking.

Well, can you list the functions you think Simple::Perl should provide?
What would you expect from it, and what wouldn't belong in it?

PY> I think this is a more important problem than figuring out how many
PY> ways of programming there are and choosing the best one out of them,
PY> in the sense that once such choice has been figured out in a given
PY> context, then just package it into an API then people don't have to
PY> worry about it in the future.

I disagree about this, but as I said it could be useful to beginners.
I'd suggest you investigate Lisp (especially the syntax tree and the
macros), Google's Guava project, and the Template Toolkit to understand
the concepts of metaprogramming and why a simple API may not be the best
approach.  Guava is probably closest to your ideal.

On Thu, 10 Jun 2010 13:23:39 -0500 John Bokma <john@castleamber.com> wrote: 

JB> But what's better? Logic in two places or in one? I have often the
JB> feeling that dumbing down a template language results in reinventing
JB> HTML and making it smarter and smarter results in the reinventing of
JB> PHP (but better :-D ).

There's quite a few opinions on this balance (which I'd say is one of
the fundamental elements of programming) in the terrific "Coders at
Work" interviews by Peter Seibel; L Peter Deutsch in particular comments
on how frustrating it is that today's software has essentially made no
progress since the late 60's to abstract logic and constraints out of
the code.  I think Lisp macros are the best answer to your question so far.

JB> IMO: Perl has a strong focus on not breaking things, while Python has a
JB> strong focus on cleaning up the language / extending the language in a
JB> clean way (if it makes it more Pythonic). I still don't know what's
JB> better. I wish that Perl by now had real OO support and real
JB> exceptions. OTHO, I manage and I do like how flexible Perl can be. And
JB> its (relative) speed.

I simply don't enjoy the dry Python syntax.  Java is similarly boring
(though it has become livelier with generics and now the upcoming Java 7
features).  Perl and Lisp (and Ruby, their mutant child, which I kind of
like) are much more fun to write and so I do.  IMHO every programmer has
these likes and dislikes and we simply layer excuses on top :)

Ted


------------------------------

Date: Fri, 11 Jun 2010 03:11:36 -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: <68eebe3d-e538-4646-bff3-17ff47c89123@i31g2000yqm.googlegroups.com>

On Jun 10, 8:32=A0am, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Wed, 09 Jun 2010 12:15:18 -0500 John Bokma <j...@castleamber.com> wrot=
e:
>
> JB> Peng Yu <pengyu...@gmail.com> writes:
>
> >> 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.
>
> JB> Even if a language has a limited number of keywords and ways to do
> JB> things there are still a huge number of ways to implement an
> JB> algorithm. If in doubt, check out Python. Or better, repost the "how =
to
> JB> read the first 3 lines of a file" question in comp.lang.python, grab
> JB> some popcorn, sit back, and watch the drama unfold :-).
>
> I think Peng Yu is asking for something like List::Utils but more
> general. =A0It's not a terrible idea; Simple::Perl (analogous to
> Modern::Perl) could be useful to beginners and could even be a way to
> teach efficient Perl (through an option to show the generated code). =A0I=
t
> would certainly be better than a DSL. =A0Another parallel is the Template
> Toolkit, which has lots of primitives that make writing raw Perl less
> necessary.

Yes. Essentially this is what I'm asking.

> But deciding what will be in the API is a very hard task, and
> implementing it will be no easier.

Agreed.

I think this is a more important problem than figuring out how many
ways of programming there are and choosing the best one out of them,
in the sense that once such choice has been figured out in a given
context, then just package it into an API then people don't have to
worry about it in the future.


------------------------------

Date: Fri, 11 Jun 2010 05:53:01 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: Why does perl allow so many different ways of doing essentially  the same thing?
Message-Id: <0b7a087f-4a4b-4361-9343-166e915411b0@c33g2000yqm.googlegroups.com>

On Jun 11, 5:55=A0am, Peng Yu <pengyu...@gmail.com> wrote:
> And I would like to know how much time and effort it would require to
> know the different between the different code and how much actually
> difference (say in performance or whatever metrics) can be gained by
> careful choosing different ways.

Let's suppose you need to extract some values from a string. Off the
top of my head, I can think of four ways that I have used this week.
Other will undoubtedly know other ways.
 - C programmers would naturally tend to use substr().
 - Perlistas would probably tend to use a regular expression.
 - parse_line() from Text::ParseWord is very handy
 - split() is also good

Which of these is 'best' depends on the particular job you want to do.
For example, if you want the first four characters of the string, use
substr(); if you want to break the line on a tokes (such as a space),
use split(); if it's a delimited string, use parse_line(); and if you
have to extract values based on arbitrary delimiters, a RE will serve
you well.

Now, as a competent programmer, you would know how these work, when to
use them, and the benefits and costs of each. Do you really think this
is a waste of time and effort? If you wanted to decompose your tasks
into many, similar categories, and propose a tool for each different
category, you could do that, it it strikes me that doing so would have
greater costs and fewer benefits than learning several tools and when
to use them.

To get to my workplace, I can take a divided, limited access road
which has few stops and a higher speed limit, but which tends to be
gridlocked at particular times. Or, I can take back streets, which
have lots of stops and turns and lower speed limits, but very little
traffic. Which one I take largely depends on the time of day I'm going
to work or coming home -- I generally choose the faster way.

Do you really think it a waste of time and effort to explore the
different routes to my work place? Why should I be compelled to pick
one 'best' way and forgo all the others?

CC


------------------------------

Date: Fri, 11 Jun 2010 07:54:47 -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: <031bddf8-aa29-4f59-83a9-5254f9bc535e@d37g2000yqm.googlegroups.com>

On Jun 11, 7:53=A0am, ccc31807 <carte...@gmail.com> wrote:
> On Jun 11, 5:55=A0am, Peng Yu <pengyu...@gmail.com> wrote:
>
> > And I would like to know how much time and effort it would require to
> > know the different between the different code and how much actually
> > difference (say in performance or whatever metrics) can be gained by
> > careful choosing different ways.
>
> Let's suppose you need to extract some values from a string. Off the
> top of my head, I can think of four ways that I have used this week.
> Other will undoubtedly know other ways.
> =A0- C programmers would naturally tend to use substr().
> =A0- Perlistas would probably tend to use a regular expression.
> =A0- parse_line() from Text::ParseWord is very handy
> =A0- split() is also good
>
> Which of these is 'best' depends on the particular job you want to do.
> For example, if you want the first four characters of the string, use
> substr(); if you want to break the line on a tokes (such as a space),
> use split(); if it's a delimited string, use parse_line(); and if you
> have to extract values based on arbitrary delimiters, a RE will serve
> you well.
>
> Now, as a competent programmer, you would know how these work, when to
> use them, and the benefits and costs of each. Do you really think this
> is a waste of time and effort? If you wanted to decompose your tasks
> into many, similar categories, and propose a tool for each different
> category, you could do that, it it strikes me that doing so would have
> greater costs and fewer benefits than learning several tools and when
> to use them.
>
> To get to my workplace, I can take a divided, limited access road
> which has few stops and a higher speed limit, but which tends to be
> gridlocked at particular times. Or, I can take back streets, which
> have lots of stops and turns and lower speed limits, but very little
> traffic. Which one I take largely depends on the time of day I'm going
> to work or coming home -- I generally choose the faster way.
>
> Do you really think it a waste of time and effort to explore the
> different routes to my work place? Why should I be compelled to pick
> one 'best' way and forgo all the others?

I think that we are talking pass each other. The examples that you
raise all can be encapsulated into different subroutines. I have no
problem that all the possible ways that you mentioned should be known,
because they are different things in terms of what they do.

To be clear what I mean, let's take some examples from the read a few
line thread. These different code essentially does the something (i.e,
read line by line). The difference is how the same thing (read line by
line) is expressed. Is really important to be able to expression the
same thing in different ways? Is there any big performance difference
(or anything at all) between different code?

One drawback of having different way of expression to do the same
thing like this is that it make the source code hard to be analyzed
(suppose, e.g., people want to study source to discover some redundant
code and do re-factoring).

my @lines;
my $limit =3D 3;
for my $line(0..$limit-1) {
    $lines[$line] =3D <IN>
}

####or
    my @lines;
    push @lines, <IN> for 0..2;

#####or
    my @lines =3D map <IN>, 0..2;
###or
for (my $i =3D 0; $i < 3; $i++) {
   push @lines, <IN>;
 }
####or
my @lines;
while (<>) { push @lines,$_ if($.<4) }



------------------------------

Date: Fri, 11 Jun 2010 15:12:13 GMT
From: hymie@lactose.homelinux.net (hymie!)
Subject: Re: Why does perl allow so many different ways of doing essentially  the same thing?
Message-Id: <hnsQn.56925$h57.35351@newsfe22.iad>


In our last episode, the evil Dr. Lacto had captured our hero,
  Peng Yu <pengyu.ut@gmail.com>, who said:

>my @lines;
>my $limit = 3;
>for my $line(0..$limit-1) {
>    $lines[$line] = <IN>
>}

>####or
>    my @lines;
>    push @lines, <IN> for 0..2;

"push" is a shortcut for the above function.  Are you saying that there
shouldn't be a "push" function?  Or that the "push" function should have
been specifically written to disallow its use for reading lines from stdin?

>#####or
>    my @lines = map <IN>, 0..2;

Are you saying that there shouldn't be a "map" function?  Or that the "map"
function should have been specifically written to disallow its use for
reading lines from stdin?

>####or
>my @lines;
>while (<>) { push @lines,$_ if($.<4) }

Are you saying that there shouldn't be a "$." variable?  Or that the "$."
variable should have been specifically written to disallow its use for
reading lines from stdin?

--hymie!    http://lactose.homelinux.net/~hymie    hymie@lactose.homelinux.net
-------------------------------------------------------------------------------


------------------------------

Date: Fri, 11 Jun 2010 10:25:58 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: Why does perl allow so many different ways of doing essentially  the same thing?
Message-Id: <0ac4a0c4-f4df-41d2-a6e0-ac69182c4a2d@a40g2000vbl.googlegroups.com>

On Jun 11, 10:54=A0am, Peng Yu <pengyu...@gmail.com> wrote:
> One drawback of having different way of expression to do the same
> thing like this is that it make the source code hard to be analyzed
> (suppose, e.g., people want to study source to discover some redundant
> code and do re-factoring).

In a recent thread, 'to RG - Lisp lunacy and Perl psychosis', we have
these examples.

Example 1, by me:
if ($sec{$k}{'xlist'} !~ /\d/)
  { $fac{$sec{$k}{'id1'}}{'location'} =3D $sec{$k}{'site'}; }
elsif ($sec{$k}{'xlist'} eq $sec{$k}{'crs_id'})
  { $fac{$sec{$k}{'id1'}}{'location'} =3D $sec{$k}{'site'}; }
else
  { $fac{$sec{$k}{'id1'}}{'location'} =3D $sec{$sec{$k}{'xlist'}}
{'site'}; }

Example 2, by Ben Morrow
my $seck  =3D $sec{$k};
    my $xlist =3D $seck->{xlist};
    my $id1   =3D $seck->{id1};
    my $fack  =3D $fac{$id1};

    if ($xlist !~ /\d/) {
        $fack->{location} =3D $seck->{site};
    }
    elsif ($xlist eq $seck->{crs_id}) {
        $fack->{location} =3D $seck->{site};
    }
    else {
        $fack->{location} =3D $xlist;
    }

I write the kind of stuff in Example 1 every day, I'm comfortable with
it, I can read it, and (to me) it's clear and unambiguous. To Ben
Morrow, it's 'unreadable'.

Question: do you get clearer, more readable code by allowing
developers to work within their comfort zone, or by forcing all
developers to use arbitrary standards with which they not be
temperamentally suited?

People have different learning styles, some are visual learners, some
are auditory learners, some are haptic learners, and so on. When we
teach, we take all learning styles into account and we don't force one
style on every student.

More to the point, Perl is an open technology, which everyone is free
to use as he sees fit. Damian Conway, in his book 'Perl Best
Practices', make the point that there is no one right way to do
something, only ways that have proven useful and other ways that
aren't so useful.

I think you're beating a dead horse. Perlistas tend to be
individualistic, like the language, and you can't convince them to be
communitarian. If you like to dictate policy, learn and use Java.

CC.


------------------------------

Date: Fri, 11 Jun 2010 16:11:38 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Why does perl allow so many different ways of doing essentially the same thing?
Message-Id: <r7SdnaXWkMC3z4_RnZ2dnUVZ8midnZ2d@brightview.co.uk>

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.

Doesn't matter. For backwards compatibility reasons
I strongly doubt that "surplus" features are going
to be removed from Perl, even if we could
design/agree an elegant and efficient minimum spanning set.

   BugBear


------------------------------

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 2985
***************************************


home help back first fref pref prev next nref lref last post