I would first construct the complete command and use the same string for debugging and for running the command:
my $cmd = "ssh -qv $ssh_user\@$bkp_destination 'sed -i \"s#.*$hostname
warn "Launching [[$cmd]]";
system($cmd) == 0
or die "Couldn't launch ssh connection via [[$cmd]]: $? / $!";
That way, the command you use for debugging and the command you run cannot deviate.
Maybe using the # char (shell comment indicator) somewhere messes up your shell quoting. Even for readability, I would construct the shell string differently:
my $cmd = qq(ssh -qv $ssh_user\@$bkp_destination 'sed -i "s#.*$hostnam