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.
I think calling a Str method on an Array should force the array to stringify, then call that method. If you want to call it on each item, you can use @array.map: { .=trim }; or maybe @array».=trim Cheers, Moritz