# Check if a destination is defined unless (defined $destination) { showUsage (); } #### # Check if a destination is defined unless (defined $destination) { print "No destination given.\n"; showUsage (); } #### # Run the program and show the output my @result; @result = `$cmd 2>&1`; foreach my $result (@result) { print $result; chomp $result; } #### # Run the program and show the output system( "$cmd 2>&1") == 0 or die "rsync failed: $! / $?";