Use /msg followed by the channel name which you store in either a global variable or in $sockmark