Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Array::IntSpan::Fields

Name Array::IntSpan::Fields
Version 2.004
Located at /usr/share/perl5
File /usr/share/perl5/Array/IntSpan/Fields.pm
Is Core No
Search CPAN for this module Array::IntSpan::Fields
Documentation Array::IntSpan::Fields
Module Details Array::IntSpan::Fields

NAME

Array::IntSpan::Fields - IntSpan array using integer fields as indices


SYNOPSIS

  use Array::IntSpan::Fields;
  my $foo = Array::IntSpan::Fields
   ->new( '1.2.4',
          ['0.0.1','0.1.0','ab'],
          ['1.0.0','1.0.3','cd']);
  print "Address 0.0.15 has ".$foo->lookup("0.0.15").".\n";
  $foo->set_range('1.0.4','1.1.0','ef') ;


DESCRIPTION

Array::IntSpan::Fields brings the advantages of Array::IntSpan to indices made of integer fields like an IP address and an ANSI SS7 point code.

The number of integer and their maximum value is defined when calling the constructor (or the set_format method). The example in the synopsis defines an indice with 3 fields where their maximum values are 1,3,15 (or 0x1,0x3,0xf).

This module converts the fields into integer before storing them into the the Array::IntSpan manpage module.


CONSTRUCTOR

new (...)

The first parameter defines the size of the integer of the fields, in number of bits. For an IP address, the field definition would be 8,8,8,8.


METHODS

All methods of the Array::IntSpan manpage are available.

set_format( field_description )

Set another field description. Beware: no conversion or checking is done. When changing the format, old indices may become illegal.

int_to_field ( integer )

Returns the field representation of the integer.

field_to_int ( field )

Returns the integer value of the field. May craok if the fields values are too great with respect to the filed description.


AUTHOR

Dominique Dumont, ddumont@cpan.org

Copyright (c) 2003 Dominique Dumont. All rights reserved.

This module is distributed under the Artistic 2.0 License. See https://www.perlfoundation.org/artistic-license-20.html

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026