#!/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"; chdir $dir or die "failed to change into $dir: $!\n"; print "changed into $dir ok!\n";