Concatenate the separate strings : Concatenate « String « Perl






Concatenate the separate strings

   

#!c:\perl\bin

$string1="Perl ";
$string2="is the No 1 Web language!";

# Here are the separate strings:

print "\n\nHere is the value of \$string1\n\n";
print $string1;

print "\n\n";
print "Here is the value of \$string2\n\n";
print $string2;

print "\n\n";

# now you concatenate the separate strings:
$joinedstring=$string1 . $string2;

print "And now here is the value of \$joinedstring\n\n";
print "$joinedstring \n\n";

   
    
    
  








Related examples in the same category

1.Concatenate string
2.Concatenate strings
3.Concatenate two string value in print statement
4.Concatenate two strings
5.String concatenate operator
6.Read input lines and concatenate them.
7.Combine string concatenation operator and string multiplication operator