in reply to pass a variable or string to shell command from perl script

Just as my fellow monks before, I would really recommend to use the Perl mkdir internal command.

However, just to complete the answer to your question, you can very well pass a Perl variable to a backtick command line (or qx// or system command).

By the way, here, system would probably be better than backticks (or qx//) because you don't want to retrieve any output from the system command you're issuing, but you're probably interested (and should be) to know if the command succeeded or returned an error.

Having said that, and repeating once again, I would very much recommend to use the Perl mkdir internal command (or some of the modules recommended earlier by haukex).

Replies are listed 'Best First'.
Re^2: pass a variable or string to shell command from perl script
by afoken (Chancellor) on Dec 28, 2017 at 10:42 UTC
    system would probably be better than backticks (or qx//) because you don't want to retrieve any output from the system command you're issuing, but you're probably interested (and should be) to know if the command succeeded or returned an error.

    See also The problem of "the" default shell for why you want the multi-argument form of system if you can't use a perl build-in function or a module.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)