tim.tub
tim.tub

Reputation: 89

Perl function for escaping characters for Windows commands

I have a string in Perl which contains various special characters and I need to pass this string to a Windows command using backticks, but I don't want the special characters to mess up the command. I have found out that with Windows commands, different special characters need to be escaped in different ways. Is there a Perl function which has been specially created to escape a string in such a way as to prepare it for a Windows command?

Upvotes: 1

Views: 144

Answers (1)

zb226
zb226

Reputation: 10509

Yes, there's Win32::ShellQuote, which should do what you want.

Upvotes: 1

Related Questions