in reply to var string not printing correctly

Assuming that NetWallah is right and you've got newlines on those variables, that makes me think you're getting them from user input (a file or the console). Note that this potentially opens you up to a big security hole! I would recommend using an array to store your command, because this will let you use the safer form of system where you give it a list with more than one element. You may also want to use a module if you want to capture the output of the external command, such as capturex from IPC::System::Simple. I wrote about this topic at length here.

my @wgetlog = ('/usr/sfw/bin/wget','-r','-np', '--reject','index.html*','--https-only','--no-check-certificate', '--user',$userid,'--password',$password, "https://$server/dev/$userid/${actionid}_$pkgname");

Replies are listed 'Best First'.
Re^2: var string not printing correctly
by TonyNY (Beadle) on Jun 29, 2018 at 11:34 UTC

    Thanks haukex, I will give this a try.

      bliako made a very good point that reminded me I forgot to mention: Using the "list" form of system, or a module that avoids the shell, also avoids the issue of having to escape special characters in the strings!