Hi, I am trying to convert the string abc.def.ghi.amm to abcdefghiamm using split and concatenation. I am missing something somewhere.. please help me to fix the code
my $string = "abc.def.ghi.amm"; my @d = split(/\./,"$string"); my $e = @d; for (my $i=0; $i < $e; $i++) { print("Value of array element $i is $d[$i]\n"); } #concatenation for (my $i=0; $i < $e; $i++) { my $abc .= "$d[$i]"; } print("Value after concatenation is $abc\n"); Output I am getting is Value after concatenation is "amm" Cheers, Vishnu Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/