The "good way" is to use the concatenation operator which you want to avoid for some reason (this sounds like one of those interview questions). join could be used:
#!/usr/bin/perl use strict; use warnings; my $foo = "123"; my $bar = "456"; $foo = join "", $foo, $bar; print "$foo\n";
In reply to Re: concatenating multiple lines without using . operator
by marto
in thread concatenating multiple lines without using . operator
by anonym
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |