print substr($var, 0, index($var, ':')); #### my $p=0; print substr( $var, ($p=index($var, ':', $p+1 ))-3,3),$/ while $p > -1 ####