Thanks for the detailed response.  I know the interspersed comments won't make
some members of the list happy, but they're just opinions.

On Wed, 28 Jul 2004 13:46:07 -0500, James Edward Gray II wrote
> 
> Not a "fan" of map() and grep() or just don't understand them?

Both, didn't understand them and still find them hard to read.  I have to
worry about programmers with no Perl experience maintaining the code, and
since these structures don't seem to exist in any other languages they are
intimidating.  Plus, the Perl may need to get ported to Java or C#, which is
easiest if the logic structures can be similar.  I would only use them if they
significantly improve performance, not to reduce typing (since then I would
have to type a long comment reminding me what the logic does - your
explanation of this solution is precise but lengthy).

> It's 
> easier to read that code bottom to top, so let's start with:
> 
> map { m/\.([^.]+)$/ ? [$_, $1] : [$_, ''] } @input;

Unfortunately I really don't find this easy to read.

> Are you a "fan" of sort()?  It works just like map() and grep().

I like the convenient functionality, but I don't like the syntax.  I don't
understand why there is no between logic and @data here:

print join( $/, sort( { $a <=> $b } @data ));

These are the kinds of idiosyncrasies that make Perl difficult when coming
from other languages.

>  I think you'll surprise yourself and hopefully, become a "fan"...

I agree, I could really use these, but the fact is I probably won't be
programming Perl much longer so I may not make the effort.  If I could just
think of a way to make them clear to other programmers - maybe I'll just link
to your post in the docs.  Again, thanks for the thorough explanation.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to