Here it is....
sysopen(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;
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.net

In reply to Add hash to DB_HASH file using DB_File by kha0z

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.