On Tue, Jan 13, 2009 at 08:19:25AM -0600, Patrick R. Michaud wrote:
> > >     @array».=trim
> > 
> > Won't that fail with 'No such method' on an array of hashes? 
> > Or are hyperops applied recursively?
> 
> I would expect this to be roughly equivalent to:
> 
>     for @array { $_ .= trim; }
> 
> For an array of hashes, this would result in each hash element
> of @array being replaced with a reference to an array of the 
> trimmed string representation of the hash.

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.

Pm

Reply via email to