diff --git a/perl-lib/PgCommitFest/CommitFestTopic.pm b/perl-lib/PgCommitFest/CommitFestTopic.pm
index 3e101fc..92113ac 100644
--- a/perl-lib/PgCommitFest/CommitFestTopic.pm
+++ b/perl-lib/PgCommitFest/CommitFestTopic.pm
@@ -80,7 +80,8 @@ EOM
 sub search {
 	my ($r) = @_;
 	my $id = $r->cgi_id();
-	my $d = $r->db->select_one(<<EOM, $id) if defined $id;
+	my $d;
+    $d = $r->db->select_one(<<EOM, $id) if defined $id;
 SELECT id, name FROM commitfest_view WHERE id = ?
 EOM
 	$r->error_exit('CommitFest not found.') if !defined $d;
diff --git a/perl-lib/PgCommitFest/DB.pm b/perl-lib/PgCommitFest/DB.pm
index 4719007..adeecdb 100644
--- a/perl-lib/PgCommitFest/DB.pm
+++ b/perl-lib/PgCommitFest/DB.pm
@@ -118,7 +118,7 @@ sub select_one {
 sub tidy {
 	my ($self) = @_;
 	$self->{'dbh'}->rollback() if $self->{'dirty'};
-	return undef;
+	return;
 }
 
 sub update {
diff --git a/perl-lib/PgCommitFest/Handler.pm b/perl-lib/PgCommitFest/Handler.pm
index d94e042..19c4424 100644
--- a/perl-lib/PgCommitFest/Handler.pm
+++ b/perl-lib/PgCommitFest/Handler.pm
@@ -103,9 +103,9 @@ EOM
 		$pg_login_db->disconnect;
 		if (defined $u) {
 			my $random_bits;
-			open(RANDOM_BITS, '</dev/urandom') || die "/dev/urandom: $!";
-			sysread(RANDOM_BITS, $random_bits, 16);
-			close(RANDOM_BITS);
+			open(my $RANDOM_BITS, '<', '/dev/urandom') || die "/dev/urandom: $!";
+			sysread($RANDOM_BITS, $random_bits, 16);
+			close($RANDOM_BITS);
 			my $session_cookie = unpack("H*", $random_bits);
 			$r->db->insert('session', { 'id' => $session_cookie,
 				'userid' => $u->{'userid'} });
diff --git a/perl-lib/PgCommitFest/Patch.pm b/perl-lib/PgCommitFest/Patch.pm
index fe9a720..aebec55 100644
--- a/perl-lib/PgCommitFest/Patch.pm
+++ b/perl-lib/PgCommitFest/Patch.pm
@@ -161,7 +161,8 @@ sub view {
 	my ($r) = @_;
 	my $aa = $r->authenticate();
 	my $id = $r->cgi_id();
-	my $d = $r->db->select_one(<<EOM, $id) if defined $id;
+    my $d;
+	$d = $r->db->select_one(<<EOM, $id) if defined $id;
 SELECT id, name, commitfest_id, commitfest, commitfest_topic_id,
 	commitfest_topic, patch_status, author, reviewers, date_closed
 FROM patch_view WHERE id = ?
diff --git a/perl-lib/PgCommitFest/Request.pm b/perl-lib/PgCommitFest/Request.pm
index de6d32f..c1042ba 100644
--- a/perl-lib/PgCommitFest/Request.pm
+++ b/perl-lib/PgCommitFest/Request.pm
@@ -22,7 +22,7 @@ $CGI::DISABLE_UPLOADS = 1;  # No need for uploads at present.
 sub new {
 	my ($class, $db) = @_;
 	my $cgi = CGI::Fast->new();
-	return undef if !defined $cgi;
+	return if !defined $cgi;
 	bless {
 		'cgi' => $cgi,
 		'control' => {},
diff --git a/perl-lib/PgCommitFest/WebControl.pm b/perl-lib/PgCommitFest/WebControl.pm
index 7443a60..11af6bd 100644
--- a/perl-lib/PgCommitFest/WebControl.pm
+++ b/perl-lib/PgCommitFest/WebControl.pm
@@ -42,7 +42,7 @@ sub choice {
 	$self->{'value_key'} = 'id' if !defined $self->{'value_key'};
 	$self->{'text_key'} = 'name' if !defined $self->{'text_key'};
 	$self->{'choice'} = $choice_list;
-	return undef;
+	return;
 }
 
 sub db_value {
