Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by punch_card_don (Curate)
on Mar 05, 2013 at 18:38 UTC ( [id://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.

Replies are listed 'Best First'.
Re^2: Accessing old DBM file with DBI - "write permission"?
by Laurent_R (Canon) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1021890]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-24 04:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found