#!/usr/bin/perl -w #---AUTOPRAGMASTART--- use 5.012; use strict; use warnings; use diagnostics; use mro 'c3'; use English qw( -no_match_vars ); use Carp; our $VERSION = 0.996; #---AUTOPRAGMAEND--- use Authen::Radius; use Term::ReadKey; my $username = 'cavac'; my $password; unless (defined $password) { print 'Password: '; ReadMode('noecho'); chomp($password = ReadLine(0)); ReadMode('restore'); print "\n"; } my $r = new Authen::Radius(Host => '127.0.0.1', Secret => 'mysecret', TimeOut=>10); if($r->check_pwd($username, $password)) { print "Welcome!\n"; } else { print "***** FAIL *****\n"; }