Tuesday, August 05, 2025

readpw (password input prompt, displaying ** when typing)

use Term::ReadKey;   sub readpwd { # # Get the variables #– ($prompt)=@_; $key=0; $password=””; # print $prompt . ” : “; # Start reading the keys ReadMode(4); #Disable the control keys while(ord($key = ReadKey(0)) != 10) # This will continue until the Enter key is pressed (decimal value of 10) { # For all […]

Read More

3 subs to trim text

To trim text you can use the following. sub ltrim { my $s = shift; $s =~ s/^\s+//; return $s }; sub rtrim { my $s = shift; $s =~ s/\s+$//; return $s }; sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };  

Read More
Back To Top