Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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


Comment on Re: Creating folders using strings
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005150]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2014-12-19 12:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (81 votes), past polls