in reply to mkdir in a loop?

I noticed the "?" mark too. Check the "all_control.txt" file to see if it has any extra formatting characters. Then the following should work fine.

#!/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 after '.' mkdir ($1, 0755) || die "Unable to create directory: $!\n"; print "Created directory: $1\n" if (! $@); } # end

Edit: g0n - code tags