sub runscript { system("x.pl"); # or if it takes some time to run the script system("x.pl &"); # runs in the background } ... -command => [\&runscript]