Hello Monks, I am trying to use the storeNetBlock feature in the Net::Netmask module. I am trying to load a file into a table called $acl_tbl. The output is created from an acl file, which I am parsing for future use. I can get the storeNetBlock feature to work when I am not defining a table name, but when I define the $acl_table I see errors. Here is the code:

sub acl_parse { open (INFILE1, "<$acl_file"); open (OUTFILE1, ">$acl_out"); open (TEST, ">$acl_dump"); while(<INFILE1>) { $_ =~ s/^\s+//; push(@acl, $_); foreach $acl(@acl) { @acl_parse = split(/\s/,$acl); } if ($acl_parse[2] ne "host") { print OUTFILE1 "$acl_parse[0]|$acl +_parse[1]|$acl_parse[2]|$acl_parse[3]|$acl_parse[4]|$acl_parse[5]\n"; my $b = "$acl_parse[2]#$acl_parse +[3]"; my $acl_block=new2 Net::Netmask ( +"$b"); $acl_block->storeNetblock([$acl_t +bl]); } } }

When I run the code, I get the following error:

Pseudo-hashes are deprecated at /usr/apps/ucm/perl_mod/lib/perl5/site_perl/5.8.8/Net/Netmask.pm line 265, <INFILE1> line 17. Pseudo-hashes are deprecated at /usr/apps/ucm/perl_mod/lib/perl5/site_perl/5.8.8/Net/Netmask.pm line 265, <INFILE1> line 17. No such pseudo-hash field "3637005816" at /usr/apps/ucm/perl_mod/lib/perl5/site_perl/5.8.8/Net/Netmask.pm line 265, <INFILE1> line 17.

I know you cannot combine an array with a hash, but I'm not clear how I am doing so and I'm having trouble finding examples. Thank you


In reply to Using optional table option in Net::Netmask by cummiro

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.