in reply to what does @$ mean?

In this case, $msg is being used as a reference to an array. If you're not familiar with references, see perlreftut, perlref, and References quick reference.