From bf58554b6f08a86591e66c92ed1a905d173bf10c Mon Sep 17 00:00:00 2001 From: elserj Date: Wed, 6 Jul 2011 23:46:23 +0000 Subject: [PATCH] Fixed so that backspace works svn path=/; revision=112 --- interactome_scripts/DbiFloret.pm | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/interactome_scripts/DbiFloret.pm b/interactome_scripts/DbiFloret.pm index e443260..b99a56b 100755 --- a/interactome_scripts/DbiFloret.pm +++ b/interactome_scripts/DbiFloret.pm @@ -2,28 +2,20 @@ package DbiFloret; use DBI; -use Term::Screen::ReadLine; +use Term::ReadKey; sub dbconnect { my $self = @_; - my $screen = Term::Screen::ReadLine->new(); - # clear the screen - $screen->clrscr; - # ask for username - $screen->at(0,0)->puts("Username: "); - my $username = $screen->readline(ROW => 0, COL=>11); - - # ask for password, replace character presses with stars - $screen->at(1,0)->puts("Password: "); - my $password = $screen->readline(ROW => 1, COL => 11, PASSWORD => 1); - - $screen->at(2,0)->puts("Database: "); - my $database = $screen->readline(ROW => 2, COL => 11); - - $screen->at(3,0); - undef $screen; + print "Username: "; + chomp(my $username = ); + print "Password: "; + ReadMode('noecho'); + chomp(my $password = ); + ReadMode(0); + print "\nDatabase: "; + chomp(my $database = ); my $dbh = DBI->connect("DBI:mysql:$database;host=floret.cgrb.oregonstate.edu", $username, $password, { RaiseError=> 1, AutoCommit=>1 } -- 2.34.1