sub get_db_stuff { my ($filename) = @_; open F, $filename or die "Can't read $filename $!\n"; my $data = ; close F; # this split allows comma, tab or space separated data # but of course precludes spaces in the names my ($db,$user,$pass) = split /[,\s]+/, $data; die "Invalid $data in $filename!\n" unless $db and $user and $pass; return ($db,$user,$pass); }