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

Re: Marking a scalar as an unupgradable binary blob.

Thread Previous | Thread Next
January 28, 2014 11:29
Re: Marking a scalar as an unupgradable binary blob.
Message ID:
On 2014-01-28 12:17, Zefram wrote:

> You can't introduce a type distinction into the current
> string type because it would break existing correct code such as
> 	sub decode_latin1 { $_[0] }
> 	$text_chars = $greeting_chars . decode_latin1($name_octets);
> The octet/character distinction is currently purely intensional, and can
> change with no explicit operation in the code.  Any labels that attempt
> to track that distinction will therefore get out of synch in existing
> correct code, even if they erase themselves at the first hint of an
> ambiguous process.

So we need a new string type.

use string;

and then let a string be a blessed arrayref, where each element is a 
substring, so a bare concatenate is effectively a push.

Each substring can be an object, etc.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About