in reply to What is the right way of concatenating strings
Just playing around....more then one way to skin a cat...of course some are preferred over others:
my $input = 'hello'; my $temp = 'world'; $input = "$input $temp";
my $input = 'hello'; my $temp = 'world'; $input = $input . ' ' . $temp;
my $input = 'hello'; my $temp = 'world'; $input .= ' ' . $temp;
my $input = 'hello'; my $temp = 'world'; $input = join(' ', $input,$temp);
my $input = 'hello'; my $temp = 'world'; my @temp = split('', $input); push @temp, ' '; push @temp, $_ for split('', $temp); $input = join('',@temp);
|
|---|