PApp::Prefs - manage user-specific data.
use PApp::Prefs; # see also PApp::Session and PApp::Env
This module manages user-specific preferences, which are simply values that get associated with a particular user.
Execute the given block while the user preferences table is locked against changes from other processes. Needless to say, the block should execute as fast as possible. Returns the return value of BLOCK (which is called in scalar context).
Creates a new PApp::Prefs object for the given application path. A reference to the path variable must be apssed in, so that changes in the path can be tracked by the module.
Return the named user-preference variable (or undef, when the variable does not exist).
User preferences can be abused for other means, like timeout-based session authenticitation. This works, because user preferences, unlike state variables, change their values simultaneously in all sessions.
Set the named preference variable. If
undef, then the variable will be deleted. You can pass in (serializable) references.
Return a reference to the preferences value (i.e. a PApp::DataRef object). Updates to the referee will be seen by all processes.
These functions work like their counterparts without the
user_-prefix, but allow you to specify the userid you want to query.
Return all user ids for which the named key has the given value.
Useful for login-type functions where you look for all users with a specific value for the "username" key or similar.
Marc Lehmann <email@example.com> http://home.schmorp.de/