my $total_names = "Matthew,Thomas,Peter,Randy,George,Federick"; $total_names =~ /,([^,]+)$/; print $1 if $1;