develooper Front page | perl.perl5.porters | Postings from January 2010

Re: warding against bytes.pm

Thread Previous | Thread Next
From:
Eric Brine
Date:
January 4, 2010 08:44
Subject:
Re: warding against bytes.pm
Message ID:
f86994701001040844m7c1e4969yb0f1ee1ac17751ef@mail.gmail.com
On Mon, Jan 4, 2010 at 6:32 AM, Tom Hukins <tom@eborcom.com> wrote:

> On Mon, Jan 04, 2010 at 11:53:27AM +0100, Aristotle Pagaltzis wrote:
> > Very nearly *everything* they would want to do with bytes.pm
> > would be a mistake. Using bytes.pm in application code (as
> > opposed to guts hackery) is almost by definition a bug.
>
> perlfunc contains the following:
>  To get the length of the internal string in bytes, use
>  C<bytes::length(EXPR)>, see L<bytes>.
>
> What should it say instead?
>
>
A recent discussion on PerlMonks shows that while C<< if (bytes::length($s))
>> is faster than C<< if (length($s)) >>, C<< eq "" >> is faster yet.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About