On Wed, Jan 14, 2009 at 03:37:57AM -0800, Ovid wrote:
> ----- Original Message ----
> > From: Patrick R. Michaud <pmich...@pobox.com>
> > 
> > Oops -- I over-referenced here.  The corrected form:
> > 
> > For C< @array┬╗.=trim >,  each element of @array would be replaced 
> > with its trimmed string representation.  If @array starts out
> > as an array of hashes, then @array┬╗.=trim would leave @array 
> > with the trimmed stringification of each hash element.
> 
> I don't get this.  If I can't call @array.trim, I certainly can't call 
> %hash.trim.  If you mean stringify the hash and then trim *that*, 
> what does that mean?  

You _can_ call @array.trim -- it returns the trimmed value of the
stringified value of the array.  Arrays stringify to all of their
elements separated by a space (if the element doesn't already
end with some kind of space, although Rakudo doesn't implement
that part yet).

Stringifying a hash in Perl 6 produces a string with keys and values
separated by tab characters, and each pair terminated by a newline.
See Synopsis 2, beginning with "In order to interpolate an entire hash"...

Pm

Reply via email to