#!/usr/bin/perl use strict; my $file = "all_controls.txt"; open(FILE, "<$file") || die "Unable to open $file: $!\n"; my @file_contents = ; foreach (@file_contents) { chomp; $_ =~ /^(.*?)\..*?$/; # remove filename extension after '.' mkdir ($1, 0755) || die "Unable to create directory: $!\n"; print "Created directory: $1\n" if (! $@); } # end