List getters getting in the way #10

mzedeler opened this Issue Jul 4, 2013 · 2 comments

2 participants


The current implementation of list getters for things like osfamily are
cumbersome to use and not very perlish.

If I want to get all the available osfamily names, as I understand it, I
have to write something like this:

my @families;
my $i = 0;
while(1) {
    my $family = $os->osfamily($i);
    break if $family eq $osfamilies[$i-1];
    push @families, $family;

If the method call just returned an array, getting any part of the list
would be simple:

# get first os family

# get last os family

# get the count of os families
scalar $os->osfamily();

The fact that $os->osfamilies($i) returns the last item on the list for
any number of $i greater that the last index is making it even harder to
work around this problem, since you don't have any simple stopping

I don't mind writing a patch for this.

Modernistik member

If you provide a patch, I don't mind including it. Let me know.


Hi @apersaud - thanks for the heads up. I'm not using this module any longer.

@mzedeler mzedeler closed this Jan 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment