in reply to Database?

Of course, if it is a really simple format and you don't need to do anything very fancy, you could just do it manually (assuming records are separated by blank lines, that "Name" is your main key, and that "Name" appears before all other lines in each record):
open FILE, "<file" or die "$!\n"; { local $/=""; while ($rec=<FILE>) { my @fields=split("\n", $rec); my $key; foreach (@fields) { my ($index, $value)=split(/\s*:\s*/, $_, 2); if ($index eq 'Name') { $key=$index; $db{$key}={}; } else { $db{$key}->{$index}=$value; } } } close FILE; }
This will leave the data in %db, indexed by Name, and each element will be a hash reference with two elements called Othername and postmaster.

--ZZamboni

Replies are listed 'Best First'.
This is what I use currenly :)
by Anonymous Monk on May 10, 2000 at 02:22 UTC
    Yikes...i keep forgetting about the lack of carrage returns
    ################################
    sub ParseProfile {
    my($filename) = @_;
    open(PROFILE,$filename);
    @PROFILE = <PROFILE>;
    close(PROFILE);
    my(%profile);
    $i = 0;
    while (@PROFILE$i ne "") {
    @LINE = split(": ", @PROFILE$i);
    $value = "@LINE1"."@LINE2"."@LINE3".
    "@LINE4"."@LINE5";
    @temp = split("\n", $value);
    $value = join("", @temp);
    $profile{@LINE[0]} = $value;
    $i = $i + 1;
    }
    return %profile;
    }
    ###############################
    sub SaveProfile {
    my($profile_path, %profile) = @_;
    open(PROFILE,">$profile_path");
    while (($key, $val) = each %profile) {
    print PROFILE "$key: $val\n";
    }
    close(PROFILE);
    }
    ###############################