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
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/