Hello,

I am trying to use the Net::IP module within a template and seem to be
having some problems.
I am setting LOAD_PERL and just loading the standard Perl Net::IP module.

I can instantiate an object as follows:

[%  connector1 = '1.2.10.128/29' %]

[%- USE c1_net = Net::IP ( connector1 ) -%]

This works fine and I can access the object as expected:

connector1 = [% c1_net.prefix %]
connector1 = [% c1_net.ip %] [% c1_net.mask %]

returns

connector1 = 1.2.10.128/29
connector1 = 1.2.10.128 255.255.255.248

The problem comes when I want to use the ip_add_num method.
This method increments the IP address by the number given and returns
another Net::IP object.
I am trying to use it as follows:

[% c2_net = $c1_net.ip_add_num(2) %]

(This should return a Net::IP object with "1.2.10.130/29")

I don't seem to be getting an error, or any kind of output.

connector2 = [% c2_net.prefix %]

returns

connector2 =


Any help/suggestions are welcome.

Thanks
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to