[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] passwd file fwacking (fwd)



Jeff Pinyan writes:
> I wince slightly when I see constructs like
>   @silly_way_to_unpack = map { ord } split //, $name;
> (Yes, poor example, since unpack("C*", $name) is much better.)
> I've done benchmarks that show that
>   map ord, split //, $name;
> is faster.

This is Fun With Perl, so I'll forgive you.  But I wince when I see
map EXPR,LIST as it's harder (imho) to read than map BLOCK LIST.  And
in most cases the speed problem is unlikely to be of such importance
that it justifies sacrificing readability.

The speed problem with a block is unfortunate.  I wonder if it's
possible to optimize the block setup/teardown away (I'm assuming
that's what's slowing it down) if the block has no my/local constructs
in it.

Nat
>>todo

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe