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

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.