#!/usr/bin/env perl use strict; use warnings; use autodie; my $name_file = 'names.txt'; open my $name_file_fh, '<', $name_file; chomp(my @names = <$name_file_fh>); close $name_file_fh; print 'Enter login name: '; chomp(my $input = ); print "Invalid!\n" unless grep { $_ eq $input } @names;