use strict; use warnings; sub run_and_log { my ($cmd) = @_; #your code here } run_and_log($ARGV[0]);