NAME

Tie::Array::IntSpan - Tied-array interface for Array::IntSpan

VERSION

This document describes version 0.001 of Tie::Array::IntSpan (from Perl distribution Tie-Array-IntSpan), released on 2021-07-25.

SYNOPSIS

use Array::IntSpan;
use Tie::Array::IntSpan;

my $intspan = Array::IntSpan->new([0, 59, 'F'], [60, 69, 'D'], [80, 89, 'B']);
tie my @ary, 'Tie::Array::IntSpan', $intspan;

# use the array like a regular one
say for @ary;
print join("", @ary[81,65,0]); # => "DBF"
$ary[30] = 'C'; # breaks up the first range

DESCRIPTION

This module provides tied-array interface for Array::IntSpan. It might be convenient if you want to access an Array::IntSpan object like a regular Perl array. But note that the tied-array interface does not expose the full power of the Array::IntSpan, e.g. you cannot create a new range or directly modify whole ranges. That's why you pass the Array::IntSpan object when you initialize the tied array, so you can access the object directly to do things you can't do with the tie interface.

Caveats:

  • Does not handle negative range (e.g. [-5, -1, 'foo']) well

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Tie-Array-IntSpan.

SOURCE

Source repository is at https://github.com/perlancar/perl-Tie-Array-IntSpan.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Tie-Array-IntSpan

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

Array::IntSpan is the backend that provides the magic.

Other Tie::Array::* modules.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.