in reply to Perl: Directoriesand files

I would add
use autodie;
, esp since you do no error checking

Then I would fix close(/FILE\d*/); so it actually DWIMs, instead of doing nothing

Then I would add
use strict; use warnings; use diagnostics;
Use strict warnings and diagnostics or die
Read this if you want to cut your development time in half!

Replies are listed 'Best First'.
Re^2: Perl: Directoriesand files
by JavaFan (Canon) on Mar 30, 2011 at 10:22 UTC
    I'd first write down what I want, then worry about details like what boilerplate to use. It's like getting from A to B, first worry about the type of transportation to use, before considering what colour paint the vehicle should have.
      It's like getting from A to B, first worry about the type of transportation to use, before considering what colour paint the vehicle should have.

      Actually, first you need a drivers license, or new drivers need a learners permit, so the boilerplate is good

        You don't need a drivers license if you take the train, or bicycle.
      Thanks, The code does actually what I want, I just want to learn to make it more neat. it seems and it feels like I'm writing to much codes for what it does. I tried using regex to try to make the code more neat but I guess I'm going the wrong way.