The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Meta::Utils::List - general library for list functions.

COPYRIGHT

Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.

LICENSE

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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.

DETAILS

        MANIFEST: List.pm
        PROJECT: meta
        VERSION: 0.39

SYNOPSIS

        package foo;
        use Meta::Utils::List qw();
        my(@list)=["sunday","monday",...];
        Meta::Utils::List::print(*FILE,\@list);

DESCRIPTION

This is a general utility perl library for list manipulation in perl. This library works mostly with list references rather than the list themselves to avoid extra work when copying them.

FUNCTIONS

        size($)
        empty($)
        notempty($)
        cmp($$$$$)
        print($$)
        add_postfix($$)
        to_hash($)
        chop($)
        add_prefix($$)
        add_suffix($$)
        add_hash_style($$)
        has_elem($$)
        add_star($$)
        add_endx($$)
        filter_prefix($$)
        filter_suffix($$)
        filter_file_regexp($$)
        filter_which($$$)
        filter_exists($)
        filter_notexists($)
        read($)
        read_exe($)
        equa($$)
        is_prefix($$)
        TEST($)

FUNCTION DOCUMENTATION

size($)

This routine returns the list size at hand (using the #$ shit...) The input is a list reference.

empty($)

This routine receives a list reference. This routine returns a boolean value according to whether the list is empty or not

notempty($)

This routine receives a list reference. This routine returns a boolean value according to whether the list is not empty or not

cmp($$$$$)

This routine compares two lists by printing any value which is in one of them but not in the other. This uses the Meta::Utils::Hash::cmp routine to chieve this. The routine also receives a verbose boolean to direct it whether to write the differences or not.

print($$)

This prints out a list. Currently just receives a list reference as input but could be enriched

add_postfix()

This postfixes every element in a list.

to_hash($)

This converts a list to a hash receiving a list reference and constructing a hash which has a key value of undef on every list entry and no other values.

chop($)

This chops up a list, meaning activates the chop function on every element. This receives a list reference to do the work on.

add_prefix($$)

This adds a prefix to every element of a list. The input is a list reference and the prefix to be added.

add_suffix($$)

This adds a suffix to every element of a list. The input is a list reference and the suffix to be added.

add_hash_style($$)

This adds an element to the list assuming that the list is a hash in disguise. i.e. it does not add the element if the element is already in the list.

has_elem($$)

This routine returns a boolean value based on whether the list it got has a certain element.

add_star($$)

This adds an element to the beginging of a list.

add_endx($$)

This adds an element to the end of a list.

filter_prefix($$)

This gets a list reference as input and produces a list of all the entires which have a certain prefix in them. Should we also have the same routine that actually does the manipulation on the list itself ? it would be faster...

filter_suffix($$)

This gets a list reference as input and produces a list of all the entires which have a certain suffix in them. Should we also have the same routine that actually does the manipulation on the list itself ? it would be faster...

filter_exists($)

This gets a list reference of file names and generates a list of all the entries in the original list which were actuall files that exist Should we also have the same routine that actually does the manipulation on the list itself ? it would be faster...

filter_notexists($)

This does the exact opposite of the previous routine. Should we also have the same routine that actually does the manipulation on the list itself ? it would be faster...

filter_which($$$)

fileters according to the relative path.

filter_file_regexp($$)

This routine gets a list reference and a regular expression. The routine will return a list reference to a list contraining all the items in the original list that when taken as file names contain a match for the regular expression. The routine utilises the check_sing_regexp routine to actuall check the regular expression match.

read($)

This reads a list from a file by storing each line in a list entry.

equa($$)

This method will get two lists by reference and will return true off the two lists are the same.

is_prefix($$)

This method will get two lists by references and will return true iff the first is a prefix of the second.

TEST($)

Test suite for this module.

SUPER CLASSES

None.

BUGS

None.

AUTHOR

        Name: Mark Veltzer
        Email: mailto:veltzer@cpan.org
        WWW: http://www.veltzer.org
        CPAN id: VELTZER

HISTORY

        0.00 MV initial code brought in
        0.01 MV this time really make the databases work
        0.02 MV make quality checks on perl code
        0.03 MV more perl checks
        0.04 MV make Meta::Utils::Opts object oriented
        0.05 MV fix up perl checks
        0.06 MV check that all uses have qw
        0.07 MV fix todo items look in pod documentation
        0.08 MV more on tests/more checks to perl
        0.09 MV more perl code quality
        0.10 MV more quality testing
        0.11 MV more perl code quality
        0.12 MV more perl quality
        0.13 MV correct die usage
        0.14 MV perl quality change
        0.15 MV perl code quality
        0.16 MV more perl quality
        0.17 MV more perl quality
        0.18 MV perl documentation
        0.19 MV more perl quality
        0.20 MV perl qulity code
        0.21 MV more perl code quality
        0.22 MV more perl quality
        0.23 MV revision change
        0.24 MV languages.pl test online
        0.25 MV PDMT/SWIG support
        0.26 MV perl packaging
        0.27 MV PDMT
        0.28 MV some chess work
        0.29 MV md5 project
        0.30 MV database
        0.31 MV perl module versions in files
        0.32 MV movies and small fixes
        0.33 MV more thumbnail code
        0.34 MV thumbnail user interface
        0.35 MV more thumbnail issues
        0.36 MV website construction
        0.37 MV web site automation
        0.38 MV SEE ALSO section fix
        0.39 MV md5 issues

SEE ALSO

Error(3), Meta::Utils::Arg(3), Meta::Utils::Hash(3), Meta::Utils::Output(3), strict(3)

TODO

-do prefix and postfix routines. the add_prefix and add_postfix routines are not good enough since they work on the list at hand. This is the most efficient way, but sometimes I dont want no one to change the current list...