Perl - Part 20

[home] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]

Retrieving and searching your saved data

In the last two tasks you accepted and saved to disk a list of names, and then recalled and printed the full list. If this list represented a database (which, in a simplistic form, it does) you would be unlikely to want all of the names, just one. We did this previously in the program names03.pl where we retrieved a name by its number (or if you prefer, it's position in the list). You're going to attempt this again but using the earlier saved file, "names.txt"

Task 023

Copy the file names03.pl to names03b.pl.

Now modify that file so that using the same file-reading mechanism from task names02b.pl you can recall one name from the set of names. Use the retrieval section from names03.pl for this.

HINT:At its simplest, this task involves putting the head of the file names02b.pl onto the body of the file names03.pl

When the program is completed print it and show it to Fachtna with screen-captures or print-outs of the data generated by the program output. Make sure your program has suitable header sections.

Onwards...

[home] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]

Last updated: 20131015-16:45