Make a folder (directory) : mkdir « File « Perl






Make a folder (directory)

    

#!/usr/bin/perl -w

use strict;

print "please enter a directory name: ";
chomp(my $dir = <STDIN>);

mkdir $dir, 0777 or die "failed to make directory $dir: $!\n";
print "made the directory $dir ok!\n";

   
    
    
    
  








Related examples in the same category

1.The mkdir function creates a new, empty directory with the specified permissions (mode).
2.To create a directory, use the mkdir command:
3.Creating Directory
4.Creating Directory with mkdir
5.Access permissions for the mkdir function.