Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi All,
I would like to concatenate more than one variable in assignment. For Ex: If I want to assign two variables in a single shot. I can use this. ($myvar1, $myvar2) = ('testing1', 'testing2'); Likewise, I would like to use this for two variables concatenation in a single shot. ($myvar1, $myvar2) = ('Hi ', 'Hello'); ($myvar1, $myvar2) .= ('Welcome', 'World'); print "$myvar1, $myvar2\n"; # prints Hi, HelloWorld The above code is doing appending value for variable-2 only. Is there any possible way to do this in a single statement ?
--
The wisest mind has something yet to learn.
In reply to Concatenating more than one variable in perl by manoj_speed
|
|