in reply to Split a Line

You can also extract a group of characters from a line with the substr function.
my $mesg = "PMMDF-REC1"; my $cmd1 = substr $mesg, 0, 1; my $cmd2 = substr $mesg, 1, 4; my $cmd3 = substr $mesg, 6, 4; print $mesg, "\n"; print $cmd1, "\n"; print $cmd2, "\n"; print $cmd3, "\n";