in reply to Getting info with a small flatfile db.
Counting lines in a file is pretty easy, too. You can slurp them all into an array (if the file is small) and evaluate the array in scalar context. Otherwise, you can loop through the entire file, line by line, and use the special variable $.. The modules named above may have their own mechanisms for doing this.
Update: Stuff the results into an array, that way you won't have to worry about it. Otherwise, you can count the number of pipes in a line with the simple: my $numpipes = $line =~ tr/\|//;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Getting info with a small flatfile db.
by bladx (Chaplain) on Aug 03, 2001 at 09:42 UTC | |
by arturo (Vicar) on Aug 03, 2001 at 16:45 UTC |