A hash in LIST context returns its keys and values.

my @foobar = %user;

In SCALAR context:

if (%user) {
    # the hash is not empty
}