Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Well, according to the docs, it is, provided you follow the docs (use flags)
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; use BerkeleyDB; for my $opts ( [], [-Flags => DB_CREATE| DB_INIT_CDB | DB_INIT_MPOOL] + ){ my $env = BerkeleyDB::Env->new( -Home => './home', @$opts, ) or warn "cannot open environment: $BerkeleyDB::Error\n"; dd $env, [ glob './home/*' ]; } __END__

On first run it doesn't exist, so first try, without flags, fails -- you need flags to initialize

$ perl berkeleydb.env.pl cannot open environment: No such file or directory (undef, []) ( bless([12346044], "BerkeleyDB::Env"), [ "./home/__db.001", "./home/__db.002", "./home/__db.003", "./home/__db.004", ], )

On second run both tries work, because its already initialized

$ perl berkeleydb.env.pl ( bless([10087228], "BerkeleyDB::Env"), [ "./home/__db.001", "./home/__db.002", "./home/__db.003", "./home/__db.004", ], ) ( bless([12336228], "BerkeleyDB::Env"), [ "./home/__db.001", "./home/__db.002", "./home/__db.003", "./home/__db.004", ], )

In reply to Re^3: can't manage to use BerkeleyDB::Env by Anonymous Monk
in thread can't manage to use BerkeleyDB::Env by grondilu

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-20 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found