Epligam Epligam - 8 months ago 36
Perl Question

Perl create folder combination of variable and underscore

How can I create a folder which is a combination of a variable and underscore ( and other special characters ) on Windows ?

I need to create this folder C:\CD12.0\PROD12.0_NEW so I tried this

use File::Basename;
use File::Path;
my $version = "12.0";
mkpath("C:/CD$version/PROD$version_NEW") or die;

Get this error

Global symbol "$version_NEW" requires explicit package name


You have to use curly braces: try ${version}