in reply to Re^2: Create new directories
in thread Create new directories
You only want to call mkdir if the line matches.if ($line =~ /mydir/) { $directory = ... mkdir $directory, 0775; }
Also, passing "\n" to mkdir doesn't make any sense here. The second argument to mkdir is a permission mode mask. See the comments on perldoc -f mkdir for more discussion on how this parameter works.
Finally, you should get accustom to using the three parameter version of open:
This is much safer.open(FILE, '<', $ARGV[0]);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Create new directories
by linuxer (Curate) on May 29, 2008 at 21:11 UTC |