in reply to perl debugging problem

Create a dummy program, such as print "$_\n" for @ARGV, call it rdist and for the run of your script, place it in your $PATH before the standard rdist.