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.
- use warnings and strict in your script
- 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:
or use autodie qw(open close); Then, is no need to check.open my $fh,'<', $filename or die "can't open file: $!"; ... close $fh or die "can't close file: $!";
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
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
In Section
Seekers of Perl Wisdom