First, the alias must start with / so that it is executed as a Perl command. Otherwise you'll be sending text to the MUD server.
You also need to escape the $ in $target, otherwise the value of the $target variable will be replaced - generating the warnings about unitialized values.
Lastly, Perl syntax requires quotes around the string value to be assigned to $target. So the replacement should be
As for the kk aliases, this one is more straightforward as you're just sending text to the server.
If you want, you can import the attached file to load the aliases in your world.