Takes its input and joins it into a single string. : join « String « Perl






Takes its input and joins it into a single string.

   
#!/usr/local/bin/perl 

@input = <STDIN>; 
chop (@input); 
$string = join(" ", @input); 
print ("$string\n"); 

   
    
    
  








Related examples in the same category

1.Join strings
2.Join the mapped value
3.Join the result of the split function
4.Join variables
5.Join with
6.Join with 'map chr'
7.Join with 'map lc'
8.Joining string with empty string