in reply to Using perl interactively with VI

I answer question 1 only. You can use this code:

$string=~ s/(.)//s; $char= $1;
This chops off the first character from $string, and puts it into $char.

There's also an other solution:

$char= substr ($string, 0, 1, "");
which does the same.