chomp does not remove all whitespace from the end of a string. I recommend that you be more explicit and use:
$mycrdir =~ s!\s*$!!;
Also, what is the error message your OS gives you in $! when creating the file fails?
In reply to Re^3: Creating a new file in a directory
by Corion
in thread Creating a new file in a directory
by parthodas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |