in reply to Re^2: Pattern Matching Question
in thread Pattern Matching Question

Noted.

But why encumber the module overhead when all you are doing is a sequential read ?

    ...each is assigned his own private delusion but he cannot see the baggage on his own back.

Replies are listed 'Best First'.
Re^4: Pattern Matching Question
by gaal (Parson) on Nov 30, 2004 at 07:29 UTC
    TMTOWTDI! The original poster mentioned reading the file to an array, so presumably that way of thinking comes more naturally for him. I'm not suggesting my version was "best"; but Tie::File *is* better than the @lines = <FILE> the OP wanted to do while allowing the same (or close enough) semantics later.

    Your method is perfectly valid, of course, and I write code like that all the time. (Though nowadays I am more likely to use a lexical filehandle.) I also alternate between using Exporter and writing my own import routines that do the same thing. It depends on what I'm optimizing for, and sometimes *that* is just writing the code quickly, so whatever comes to mind first gets to be used.