#!/usr/bin/perl -w use strict; use IPC::Open2; my @command = ( 'perl', 'my test.pl', 'first arg1', '"second arg2"', 'word "quoted" and \"backslashed\" word', '"2word "quoted" and \"backslashed\" word"', ); my $pid = IPC::Open2::open2( \*r, \*w, @command ); print "Pid = $pid\n"; print "output:\n"; print while $_ = ; print "done\n";