On Wed, Jan 14, 2009 at 03:37:57AM -0800, Ovid wrote:
> - Original Message
> > From: Patrick R. Michaud
> >
> > 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
- Original Message
> From: Patrick R. Michaud
> > 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
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; }
>
>
Ovid wrote:
> What should this output?
>
> my @array = ' foo ', ' bar ';
> @array .= trim;
>
> say @array.perl;
>
> And what if I have an array of hashes of hashes of arrays?
>
> Currently you can call 'trim' on arrays, but it's a no-op. Similar issues
> with chomp and friends.
On Mon, Jan 12, 2009 at 03:30:05PM -0800, Ovid wrote:
> > From: Larry Wall
> > : my @array = ' foo ', ' bar ';
> > : @array .= trim;
> > : say @array.perl;
> > :
> > : And what if I have an array of hashes of hashes of arrays?
> > :
> > : Currently you can call 'trim' on arrays, bu
* Ovid [2009-01-13 00:35]:
>* Larry Wall [2009-01-13 00:25]:
>> It should probably say "No such method". We have hyperops now
>> to apply scalar operators to composite values explicitly:
>>
>> @array».=trim
>
>
> Won't that fail with 'No such method' on an array of hashes? Or
> are hyperops
- Original Message
> From: Larry Wall
> : my @array = ' foo ', ' bar ';
> : @array .= trim;
> :
> : say @array.perl;
> :
> : And what if I have an array of hashes of hashes of arrays?
> :
> : Currently you can call 'trim' on arrays, but it's a no-op. Similar issues
>
On Mon, Jan 12, 2009 at 03:05:21PM -0800, Ovid wrote:
: What should this output?
:
: my @array = ' foo ', ' bar ';
: @array .= trim;
:
: say @array.perl;
:
: And what if I have an array of hashes of hashes of arrays?
:
: Currently you can call 'trim' on arrays, but it's a no-op.