in reply to var string not printing correctly

Here you go:

$ cat TonyNY.pl #!/usr/bin/env perl use strict; use warnings; my $userid = 'u'; my $password = 'p'; my $server = 's'; my $actionid = 'a'; my $pkgname = 'p'; my $wgetlog = '/usr/sfw/bin/wget -r -np --reject "index.html*" --https-only --n +o-check-certificate --user ' . $userid . ' --password ' . $password . ' https://' . $server . '/dev/' . $userid . '/' . $actionid . "_" . $pkgname . ' +/'; print "$wgetlog\n"; $ ./TonyNY.pl /usr/sfw/bin/wget -r -np --reject "index.html*" --https-only --no-che +ck-certificate --user u --password p https://s/dev/u/a_p/ $ ./TonyNY.pl | wc -l 1

Take this SSCCE, and put your own variable content in it. You'll soon find where you are going wrong (Hint: It's your $actionid value which is problematic)

And just to solve the XY problem as well, see LWP::UserAgent or any of the other web-retrieval tools on CPAN so you don't have to shell out in such a convoluted fashion in the first place.