title: Using a variable as a directory name in perl
body: <p>I am using a user input variable as my initial directory name, but when trying to expand the directory and create sub-folders, utilizing that variable causes issue in the path. </p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  
  print "What would you like to name your directory?\n"; 
  chomp( my $directory = &lt;STDIN&gt; );
  
  mkdir $directory, 0755;
  mkdir $directory/data, 0755; ##&lt;----&lt;&lt;Error begins here##
  mkdir $directory/data/image, 0755;
  mkdir $directory/data/cache, 0755;
  </code></pre>