in reply to text file database - Objects?
Here's a simplified snippet of the read and store code.
my @movieList = (); my $index = 0; open(DATA, $dataFile); while (<DATA>) { chomp; if (/^\s+$/) { next; } # skip blank lines in datafile my @data = split("\t"); my $title = &getString( shift(@data) ); my $year = &getString( shift(@data) ); my $movieRec = { 'index' => $index, 'title' => $title, 'year' => $year, }; push(@movieList, $movieRec); $index++; } # while close(DATA);
I hope this gives you some ideas.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: text file database - Objects?
by svsingh (Priest) on May 09, 2003 at 13:18 UTC | |
by shibby (Initiate) on Jun 05, 2003 at 08:13 UTC |