in reply to Read the values from a file

This looks suspiciously like an INI-style file.
Config::Simple and a number of other modules for this purpose do the trick:

use Config::Simple;
my $cf = Config::Simple->new( syntax => "ini", filename => "your_password_file.cfg")
    or die qq(not an INI style file\n- $!);
my $login    = $cf->param("cm.login");
my $password = $cf->param("cm.password");

Cheers, Sören

Edit: added missing "my"s and boldfaced the params.