in reply to system and pipes

Seems easier to just use:
system("$tar $taropts $backupdir | $ssh $user\@$remotehost 'ddof=$remotedir/back.tar.gz'");