#!/usr/bin/perl use strict; use warnings; my $account_1 = "CALI123456-09"; my $account_2 = "FLOR1234567-01"; my $total_count_1; $total_count_1++ while ($account_1 =~ m/./g); print "Account 1 has $total_count_1 characters\n"; if($total_count_1 < 14) { substr($account_1, 4, 0) = 'X'; print "\n^$account_1^\n"; } print "\n*$account_1*\n"; print "*$account_2*\n";