#!/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";