if($text =~ /^\*msg (.+)/) { @msg = split(/\s+/, $text); $vic = shift @msg; print 'to ' . $vic . ': ' . join(' ', @msg) . "\n"; }