Check "all_control.txt" for any extra formatting characters. #!/usr/bin/perl use strict; my $file = "all_controls.txt"; open(FILE, "<$file") || die "Unable to open $file: $!\n"; my @file_contents = <FILE>; foreach (@file_contents) { chomp; $_ =~ /^(.*?)\..*?$/; # remove filename extension mkdir ($1, 0755) || die "Unable to create directory: $!\n"; print "Created directory: $1\n" if (! $@); } # end
In reply to Re: mkdir in a loop?
by wand3ringscript3r
in thread mkdir in a loop?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |