See this post. You want to do something like this:

Code:
  use Win32::DDE::Client;
 
  $Client = new Win32::DDE::Client ('[color:blue]mIRC[/color]', '[color:orange]COMMAND[/color]');
  die "Unable to initiate conversation" if $Client->Error;
 
  $cmd = '/echo -s Hello!';
  $Client->Poke ('[color:red]None[/color]', [color:green]$cmd[/color]) ||
        die "DDE poke failed";
 
  $Client->Disconnect;

(Code is based on the example in this manual page.)

mIRC is the DDE server name, COMMAND is the so-called topic, None is a placeholder for the item name (apparently you can't get away with an empty value), and $cmd is the data.

If you want mIRC to evaluate an identifier for you, use this code:

Code:
  use Win32::DDE::Client;
 
  $Client = new Win32::DDE::Client ('[color:blue]mIRC[/color]', '[color:orange]EVALUATE[/color]');
  die "Unable to initiate conversation" if $Client->Error;
 
  defined ($hesays = $Client->Request ('[color:red]$me[/color]')) ||
        die "DDE request failed";
 
  print 'Value of $me is ';
  print $hesays;
 
  $Client->Disconnect;