develooper Front page | perl.perl5.porters | Postings from July 2005

[PATCH] Missing tie() call in NDBM_File SYNOPSIS

Thread Next
From:
Matt Sergeant
Date:
July 14, 2005 13:53
Subject:
[PATCH] Missing tie() call in NDBM_File SYNOPSIS
Message ID:
28baf339c3b78cc40017066b9dc7cffb@sergeant.org
Simple patch for an obvious omission (also fixes the lack of whitespace 
on the line before untie()):

--- ext/NDBM_File/NDBM_File.pm.orig     Thu Jul 14 16:49:22 2005
+++ ext/NDBM_File/NDBM_File.pm  Thu Jul 14 16:50:36 2005
@@ -23,12 +23,15 @@

    use Fcntl;   # For O_RDWR, O_CREAT, etc.
    use NDBM_File;
-
+
+  tie(%h, 'NDBM_File', 'filename', O_RDWR|O_CREAT, 0666)
+    or die "Couldn't tie NDBM file 'filename': $!; aborting";
+
    # Now read and change the hash
    $h{newkey} = newvalue;
    print $h{oldkey};
    ...
-
+
    untie %h;

  =head1 DESCRIPTION


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About