Hello Everyone...
I need some serious help here. I'm trying to use a module (Checkpoint.pm from http://www.wormnet.nl/). It goes through the objects.C and configs.C from Checkpoint Configs and loads the data into a hash so I can use it later.
The problem (I think) is that the file is so big that the hash hit's its limit. I see the first 9092 objects in the hash, but everything afterward doesn't get added.
Is this a size limitation of hashes in Perl? I tried this on Unix and Windows and see the same results. Is there a way to get around it? Can I tell Perl to allow extra huge hashes, even if it takes up all my memory?
Here is an example of the structure of a truncated objects.C file (object name and IP have been changed):
(
:netobj (netobj
: (objectnameishere
:DAG (false)
:add_adtr_rule (false)
:cp_products_installed (false)
:data_source (not-installed)
:enforce_gtp_rate_limit (false)
:firewall (not-installed)
:floodgate (not-installed)
:gtp_rate_limit (2048)
:ipaddr (10.1.1.1)
:type (host)
:IPSec_main_if_nat (false)
)
)
)
In my file, there are 10572 objects.
Here's the script I wrote to test it:
GetObjects("objects.C"); # Create the Object Hash;
my $line = GetKey('netobj');
foreach (keys(%{$line})) {
print "$_\n";
}
Here is the bucket details:
6995/16384
I got this by changing my test script to:
GetObjects("objects.C"); # Create the Object Hash;
my $line = GetKey('netobj');
print scalar(%{$line}) . "\n";
Thanks everyone in advance!!
Morpheous1129
(Sean McDaniel)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.