Skip to content

EXTEND changes visible size of file and array. [rt.cpan.org #39196] #17496

Closed
@toddr

Description

@toddr

Migrated from rt.cpan.org#39196 (status was 'new')

Requestors:

From ikegami@cpan.org on 2008-09-12 00:19:06
:

Bug present in at least Tie::File 0.97 and 0.97_02.

EXTEND is used to expand the internal buffer.
STORESIZE is used to actually change the visible size of the array.
Tie::File incorrectly treats EXTEND as STORESIZE.

When sorting in place (@a = sort @a) on a magical array (such as one
tied to Tie::File), sort EXTENDs the array to scalar(@a)+1 elements.

This is meant to extend the internal storage size, but it has visible
effects when the array is tied to Tie::File. The reported number of
elements is different than it should be, and a blank line is appended to
the file (in the sort example).

See http://www.perlmonks.org/?node_id=710580 for runnable code and some
extra details.


Metadata

Metadata

Assignees

No one assigned

    Labels

    dist-Tie-Fileissues in the dual-life blead-first Tie-File distribution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions