summaryrefslogtreecommitdiff
path: root/ext/NDBM_File
diff options
context:
space:
mode:
authorMatt Sergeant <matt@sergeant.org>2005-07-14 12:53:03 -0400
committerH.Merijn Brand <h.m.brand@xs4all.nl>2005-07-15 06:49:16 +0000
commitd554b888f35e2a05ab5bbf81166b4ff89aa57070 (patch)
tree62de01adb0ef1adea391588d45447ddc71d76063 /ext/NDBM_File
parent8ca3c3a5e31a51d2d8fdb1b8a1facf78c85dcf2d (diff)
downloadperl-d554b888f35e2a05ab5bbf81166b4ff89aa57070.tar.gz
Missing tie() call in NDBM_File SYNOPSIS
Message-Id: <28baf339c3b78cc40017066b9dc7cffb@sergeant.org> p4raw-id: //depot/perl@25145
Diffstat (limited to 'ext/NDBM_File')
-rw-r--r--ext/NDBM_File/NDBM_File.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/NDBM_File/NDBM_File.pm b/ext/NDBM_File/NDBM_File.pm
index a52f7ef03b..a952af2354 100644
--- a/ext/NDBM_File/NDBM_File.pm
+++ b/ext/NDBM_File/NDBM_File.pm
@@ -24,9 +24,12 @@ NDBM_File - Tied access to ndbm files
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};
+ print $h{oldkey};
...
untie %h;
@@ -49,14 +52,14 @@ C<tie> should be:
The hash variable you want to tie.
-=item 2.
+=item 2.
The string C<"NDBM_File">. (Ths tells Perl to use the C<NDBM_File>
package to perform the functions of the hash.)
-=item 3.
+=item 3.
-The name of the file you want to tie to the hash.
+The name of the file you want to tie to the hash.
=item 4.