#!/usr/bin/perl use strict; use warnings; package ExternalFunctions; sub create_encrypted { use Digest::HMAC_SHA1 qw(hmac_sha1 hmac_sha1_hex); my ( $given, $key ) = @_; my $digest = hmac_sha1_hex( $given, $key ); return quotemeta( $digest ); } sub get_word { my ( $dbh, $login_name ) = @_; my $sql_passcheck = qq{ SELECT word FROM residents WHERE login_name = ? }; my $sth = $dbh->prepare($sql_passcheck); $sth->execute( $login_name ); my ($saved_pass) = $sth->fetchrow_array; $sth->finish(); return $saved_pass; } 1;