--- David Michael <[EMAIL PROTECTED]> wrote:
> I need help. I am a newbie. I am frustrated.
> I am working with a dbm file. It has data in it. The data is
> formatted in this way:
>
> key = name: parameter\n name: parameter\n name: parameter\n
>
> I want to get rid of the 'name' and just get the 'parameter'.
>
> The parameter may have spaces in it, so i tried to do a split on :
> and \n. I do not know what i am doing wrong. Please help me. Thank
> you.
hrm...try this:
my $name;
my $rec = $DBM{$key}; # use whatever names you have. I made these up.
for my $pair (split /\n/m, $rec) {
($name) = split /:/, $pair;
# then do whatever with $name
}
Check the syntax, but I think you need the /m on that split pattern to
tell it there are newlines embedded.
Got no Perl on this machine at home to test it, tho....
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/