Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Accessing old DBM file with DBI - "write permission"?

by punch_card_don (Curate)
on Mar 05, 2013 at 18:38 UTC ( #1021890=note: print w/ replies, xml ) Need Help??


in reply to Accessing old DBM file with DBI - "write permission"?

On the other hand, this works:

#!/usr/bin/perl -w use warnings ; use strict ; use DB_File ; my %h; unlink "data" ; tie %h, "DB_File", "data", O_RDWR|O_CREAT, 0666, $DB_HASH or die "Cann +ot open file 'data': $!\n"; print "Content-type:text/html\n\n"; foreach my $key (sort keys %h) { print "<br>$key -> $h{$key}\n"; }
But I get an empty result, no output. (Possible that's what's in the file, I suppose, but seems odd for a 65kb file.)



Time flies like an arrow. Fruit flies like a banana.


Comment on Re: Accessing old DBM file with DBI - "write permission"?
Download Code
Re^2: Accessing old DBM file with DBI - "write permission"?
by Laurent_R (Prior) on Mar 05, 2013 at 18:47 UTC

    Maybe you could try to create an empty DBM file and see how big it is on your system.

      In themeantime, I found a filepath that was wrong - so now this version works perfectly. Outputs 200 lines of pairs, as sort of expected.

      So, my needs have been solved - just the mystery of the DBI version for information left.




      Time flies like an arrow. Fruit flies like a banana.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021890]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2015-07-06 22:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (84 votes), past polls