cummiro has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using optional table option in Net::Netmask
by choroba (Cardinal) on Oct 20, 2011 at 15:29 UTC | |
by Anonymous Monk on Oct 21, 2011 at 10:40 UTC | |
|
Re: Using optional table option in Net::Netmask
by mrstlee (Beadle) on Oct 21, 2011 at 14:40 UTC | |
by cummiro (Initiate) on Oct 21, 2011 at 21:02 UTC | |
by mrstlee (Beadle) on Oct 22, 2011 at 13:01 UTC | |
by cummiro (Initiate) on Oct 25, 2011 at 15:15 UTC |