Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Creating folders using strings

by 2teez (Priest)
on Nov 22, 2012 at 15:39 UTC ( #1005150=note: print w/replies, xml ) Need Help??

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005150]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2017-12-16 16:03 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (455 votes). Check out past polls.