I have the following variables:- $a=abc.1.0.1.0 $b=bnnn.1.0.1.1 $c=dnnnnn.1.0.2.0 ....etc........ i want to split the variable $a, $b, $c and put that value in two separate varaibles. for example $a is splitted to $a2 = 1.0.1.0 (always the last four digits of the string) $a1 = abc (Rest of the String) $b is splitted to $b2 = 1.0.1.1 (always the last four digits of the string) $b1 = bnnn (Rest of the String) i am trying to get the results with a for loop Can anyone please help?