kha0z has asked for the wisdom of the Perl Monks concerning the following question:
i am tring to dump the %data hash into a scalar value so i can add it to the DB_HASH.... $username has been predefined earlier in the script. when i check the file afterwords the file size is still 0. any suggestions? kha0z -- www.kha0z.netsysopen(DB_USERS_LOCK, $lck_users, O_RDWR|O_CREAT) || die( "Cannot open $lck_users: $! " ); flock(DB_USERS_LOCK, LOCK_EX) || die( "Cannot LOCK_EX $lck_users: $! " ); tie %h, "DB_File", $users_dbm_file, O_RDWR|O_CREAT, 0640, $DB_HASH || die( "Cannot tie $users_dbm_file $! \n" ); my $data_for_db = ""; foreach ( sort keys %data ){ $data_for_db = $data_for_db . "$_ $data{$_} " } $h{$username} = $data_for_db; print $h{$username}; untie %h; close DB_USERS_LOCK;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Add hash to DB_HASH file using DB_File
by dws (Chancellor) on Apr 09, 2001 at 09:55 UTC | |
by greenFox (Vicar) on Apr 09, 2001 at 15:24 UTC | |
by dws (Chancellor) on Apr 09, 2001 at 20:20 UTC | |
by tilly (Archbishop) on Apr 09, 2001 at 21:17 UTC | |
by dws (Chancellor) on Apr 09, 2001 at 21:19 UTC | |
|