Bio::RNA::BarMap::Mapping::Set - Internally used class to store sets


    use v5.12;              # for 'say()' and '//' a.k.a. logical defined-or
    use Bio::RNA::BarMap;

    # Construct new, empty set.
    my $set = Bio::RNA::BarMap::Mapping::Set->new();

    # Insert elements.
    $set->insert( qw(hello there foo) );

    # Retrieve elements.
    say "Elements in set: ", join q{, }, $set->elements;


A simple, pure-Perl implementation of a set data structure. It is significantly faster than Set::Scalar, which became a bottleneck during the implementation of this module. It supports storing references, but no deep equality checks are performed.



Returns a new, empty set. Adding elements during construction is currently not supported (for no specific reason), use the insert() method instead.


Return all items contained in this set.


Insert one or more @elements into the set. Supports references.


Felix Kuehnl, <felix at>


Please report any bugs or feature requests by raising an issue at

You can also do so by mailing to bug-bio-rna-barmap at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Bio::RNA::BarMap

You can also look for information at the official BarMap website:


Copyright 2019-2021 Felix Kuehnl.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see