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

Re: warding against bytes.pm

Thread Previous | Thread Next
From:
Jesse Vincent
Date:
February 24, 2010 16:57
Subject:
Re: warding against bytes.pm
Message ID:
20100224173250.GA2315@bestpractical.com



On Mon 22.Feb'10 at 16:47:36 +0000, Dave Mitchell wrote:
> On Sun, Jan 03, 2010 at 11:27:22PM +0000, Dave Mitchell wrote:
> > I think these days there's a general consensus that, for normal day-to-day
> > tasks, the user has no need for bytes.pm, and indeed, that most naive use
> > of it is likely to be harmful.
> > 
> > Given that, should we add a warning to bytes.pm's pod to the effect that
> > you shouldn't be using this for new code unless you really know what you're
> > doing, and that a desire to do so probably indicates a design flaw in your
> > code or your understanding of perl's Unicode implementation?
> 
> Following the discussion, I've committed the following:

Based on your explanation, "deprecate" feels like a very strong
statement. It's more of a "This library does unspeakable things to Perl's
understanding of strings. It's unlikely that you want to use it. Instead
have a look at ..."

Or do we actually have a better way to do _everything_ bytes does?

-Jesse

 
> commit a515200d681686a605e69620572e93eba2acd0a4
> Author:     David Mitchell <davem@iabyn.com>
> AuthorDate: Mon Feb 22 15:25:16 2010 +0000
> Commit:     David Mitchell <davem@iabyn.com>
> CommitDate: Mon Feb 22 15:25:16 2010 +0000
> 
>     deprecate bytes.pm
> 
> 
> Affected files ...
>     
>     M	lib/bytes.pm
> 
> Differences ...
> 
> diff --git a/lib/bytes.pm b/lib/bytes.pm
> index b7fabbf..31294cb 100644
> --- a/lib/bytes.pm
> +++ b/lib/bytes.pm
> @@ -1,6 +1,6 @@
>  package bytes;
>  
> -our $VERSION = '1.03';
> +our $VERSION = '1.04';
>  
>  $bytes::hint_bits = 0x00000008;
>  
> @@ -33,6 +33,18 @@ __END__
>  
>  bytes - Perl pragma to force byte semantics rather than character semantics
>  
> +=head1 DEPRECATED
> +
> +This pragma reflects early attempts to incorporate Unicode into perl and
> +has since been superceded. It breaks encapulation (i.e. it exposes the
> +innards of how perl happens to be currently storing a string), and use of
> +this module for anything other than debugging purposes is strongly
> +discouraged. If you feel that the functions here within might be useful
> +for your application, this possibly indicates a mismatch beteen your
> +mental model of Perl Unicode and the current reality. In that case, you
> +wish to peruse some of the perl Unicode documentation: L<perluniintro>,
> +L<perlunitut>, L<perlunifaq> and L<perlunicode>.
> +
>  =head1 SYNOPSIS
>  
>      use bytes;
> 
> 
> -- 
> Please note that ash-trays are provided for the use of smokers,
> whereas the floor is provided for the use of all patrons.
>     -- Bill Royston

> 


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