Hi,
Thomas Klausner wrote:
> my $string=<a b c> >>~<< <1 2 3>;
> say $string;
> # prints a1 b2 c3
>
> But where do the spaces in the second example come from?
the spaces come from the stringification of lists/arrays:
my @array = <a b c d>;
say [EMAIL PROTECTED]; # "a b c d"
You can use
say [~] @array; # "abcd" or
say @array.join(""); # "abcd" or
say join "", @array; # "abcd"
if you want to supress the spaces.
And you could override this by doing something like:
class MyArray is Array {
method *prefix:<~> (@self: ) { [~] @self }
}
my @array is MyArray = <a b c d>;
say [EMAIL PROTECTED]; # "abcd"
--Ingo
--
Linux, the choice of a GNU | The computer revolution is over. The
generation on a dual AMD | computers won. -- Eduard Bloch <[EMAIL PROTECTED]>
Athlon! |