join() function in Perl is responsible for joining all the elements in an array into a single string.
#!/usr/bin/perl print "content-type: text/html \n\n"; @array = ("David","Larry","Roger","Ken","Michael","Tom"); $astring = join(",",@array); print $astring."\n"; @array2 = qw(Pizza Steak Chicken Burgers); $string = join("\n",@array2); print $string;
Output: ------- David,Larry,Roger,Ken,Michael,Tom Pizza Steak Chicken Burgers
AllBlogToolsFacebook comments for blogger brought to you by AllBlogTools.com , Get Yours?