in reply to Password with special characters

I wrote about this topic at length here. In this case, assuming this is on Windows, you might want to just use Win32::ShellQuote, e.g. its quote_system_list - but make sure to read the module's documentation in any case.

Update: For example, system(quote_system_list('NET','USE','g:','\\\\<NETWORK DRIVE>\\<NETWORK FOLDER>',$pw,'/user:<USERNAME>'))==0 or die "system failed, \$?=$?";

Replies are listed 'Best First'.
Re^2: Password with special characters (updated)
by texmex72 (Initiate) on Jun 24, 2019 at 19:48 UTC

    Thank you for your help it sent me in the right direction and I was able to use ShellQuote::Any::Tiny qw(shell_quote) to get my command to run. Have a great day.