I use mkdir in Perl. It makes dir, but sometimes it adds a ? to the end of the directory name -


here code:

foreach $name ( @unique_gene_list ) {     print "$name\n";     chomp $name;       unless(mkdir $name, 0700) {         die "unable create directory called $name\n";     } }      

this works, mostly. reason, 1 of directories given name ends ?. should note directory name showing in terminal window shows question mark. in finder, there no question mark @ end of directory's name. use perl v.5.12.3, on mac os 10.7.5.

the file reading has lines ending in crlf. removing lf chomp, cr (represented ^m) isn't removed. instead of chomp;, use s/\s+\z//;.

while (<$fh>) {    s/\s+\z//;    ... } 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -