Storing User Preferences

In this section, we’ll write an application, prefs.pl, that uses sessions to manage user profiles. The particular scenario involves management of page-display preferences, although for simplicity we’ll limit the scope of these preferences to a block of text displayed in the pages generated by the application itself. At the end of this section, you’ll find a few suggestions for other ways to use profiles by making a few changes to the concepts presented here.

The script prefs.pl is designed to keep track of page-display preferences stored in a session record: You can select a font size (small, medium, large), and text attributes (bold, italic). It presents a page that shows some sample text displayed using your current ...

Get MySQL and Perl for the Web now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.