Lets suppose I have a base directory /home/user/test/. Now, I have two strings a , b which are going to be the folder inside the base directory like /home/user/test/a/b.
Currently what I am doing is:
use File::Path qw(make_path);
my $path = "$basedir"."/"."a"."/"."b"
make_path("$path");
Now, what am looking for is:
my $dir = "/home/user/test";
my $x = "a";
my $y = "b";
make_path($dir, $x, $y);
But when I run the above code instead of creating /home/user/test/a/b it creates two separate directory a and b in the current working directory.
So, what is the correct way to achieve this.?
Here is an easy way to do it:
Look up
joinfor more information.