Name

isAnon — tests to see if the given user ID belongs to the Anonymous User

Synopsis

isAnon($uid);

isAnon is a quick but effective way to test if a given user is registered or not. It returns true if the user is anonymous, false otherwise. This function handles non-UIDs safely, so it can be used where a user structure is not fully built. It is exported from Slash::Utility::Environment.

Example

use Slash::Utility;
return if isAnon($user->{uid});

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.