open( my $config_fh, '< :encoding(UTF-8)', '/some/path/.tofile' ) or die "$0: Can't open config file. $!\n"; my %creds = map { $_ =~ /(\S+)\s*?:\s*?(\S+)/ } <$config_fh>;