use strict; use warnings; # First things first. If I can't figure out who you are, you're outta here. my $editor; if ( exists( $ENV{REMOTE_USER} ) ) { ($editor) = $ENV{REMOTE_USER} =~ m/(some regex)/i; } (defined $editor) || die "I can't determine who you are, so you can't access this area."; #use editor later throughout the program