# Run executable @system command, reporting name as $name If there # is an upload limit, we run through trickle(1) to limit bandwidth. sub _ext_cmd { my ($name, @system) = @_; if ($o{general}{upload}) { @system = ($o{general}{trickle}, $o{general}{trickled} ? () : '-s', -u => $o{general}{upload}, '|', @system); } say "Running name=$name, @system"; # system { $system[0] } @system[1..$#system]; # Obviously nope. say "\$?=$?"; } #### # Excerpt of %o options hash: %o = ( general => { upload => '256', # KBps trickle => '/bin/trickle', trickled => undef, # True if trickled is installed }, ); # Example usage: _ext_cmd(display_name => qw!/bin/duplicity /path/to/src /path/to/dest!); # ... but you could probably test it just fine with echo or /bin/cat.