http://www.perlmonks.org?node_id=1005150


in reply to Creating folders using strings

Hi learninPerl,
choroba has given you in my considered opinion, the best answer. However, if you don't mind, there are some good practice you may develop as you program in Perl.

  1. use warnings and strict in your script
  2. Avoid bareword as filehanles, use lexical variable in your open function.
    use 3 argument open function and always check, if that fails. The same goes for close function.
    like so:
    open my $fh,'<', $filename or die "can't open file: $!"; ... close $fh or die "can't close file: $!";
    or use autodie qw(open close); Then, is no need to check.

In addition, you can actually run your script from the location, where you wanted the folders to be created ( but that will be 'restricting' yourself script ) :).

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me