in reply to Re: Modular Code
in thread Modular Code

Put some quotes around 'myfile.txt' and the code will work as intended.

I recommend using strict. It seems hard at first, but it is worth it in the long run.

The biggest problem with slurping whole files into memory, is memory. If you know you will only be looking at a small number of small files it is OK. But what if someone throws a 250MB file into the mix? It is often better to process a file line by line.

If you find yourself passing large arrays or hashes around, it is considerably faster and less memory intensive to pass a reference. Passing references will be faster and use less memory. Check out Dominus' Reference Tutorial

For more on OOP, check out perlman:perltoot.


TGI says moo

Replies are listed 'Best First'.
Re: Re: Re: Modular Code
by Stamp_Guy (Monk) on Jun 15, 2001 at 06:58 UTC
    Thanks TGI, I'm using strict. I just forgot to mention it. These are pretty much tiny files not over 20k. The biggest might be 100k. I'll check out that reference tutorial...

    Stamp_Guy