%seen is a hash, and so $seen{$user} = 1; sets the key stored in $user in %seen to 1 (perldata). 1 is true in Perl, so the second time the same key is encountered, the test if ($seen{$user}) { will be true, and the code will execute next, skipping ahead in the for loop.