my $word = join('', @letters);
and
my $word = reverse(reverse(@letters));
and
my $word = do { local $"=''; "@letters" };
and
my $word; map { $word .= $_ } @letters;
ok, so the last one is pretty much the same as:
my $word; $word .= $_ foreach (@letters);
In reply to Re: Assigning an array to a scalar
by ikegami
in thread Assigning an array to a scalar
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |