open(PIPE,"who |") or die "Can't run 'who': $!\n"; while() { my ($user, $remainder) = split; # implicit split splits $_ on /\s+/ $hash{$user}++;