Why can't you use something like this? Although the user can see the password if he opens the script.
#!/usr/bin/perl
use strict;
print "Enter password: \n";
chomp( my $answer = <> );
die "Incorrect password.\n"
if ( $answer eq 'password' );
# ... main program is here #