in reply to perl and DDE
You may prefer the wrapper layer Win32::mIRC. But anyway you do it like:
$eval = new Win32::DDE::Client ('mIRC', 'EVALUATE'); $response = $eval->Request('CHANNELS'); [download]
cheers
tachyon