Name

getCurrentUser — retrieves information about the current user by key or as a hash reference

Synopsis

my $user = getCurrentUser();
my $value = getCurrentUser($name);

With no parameters, getCurrentUser returns a hash reference of the current user’s information. If the optional $name parameter is provided, it returns the associated value within the user information, if present, and the undefined value if not. This is exported from Slash::Utility. If the program is not running under mod_perl, and if createEnvironment has not been called, the hash reference may be empty.

Example

use Slash::Utility;
my $user = getCurrentUser();

my $nickname = getCurrentUser('nickname');

Get Running Weblogs with Slash 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.