You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
$i++;
}
If the method call just returned an array, getting any part of the list
would be simple:
# get first os family
$os->osfamily()[0];
# get last os family
$os->osfamily()[-1];
# 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
condition.
I don't mind writing a patch for this.
The text was updated successfully, but these errors were encountered:
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, Ihave to write something like this:
If the method call just returned an array, getting any part of the list
would be simple:
The fact that
$os->osfamilies($i)
returns the last item on the list forany number of
$i
greater that the last index is making it even harder towork around this problem, since you don't have any simple stopping
condition.
I don't mind writing a patch for this.
The text was updated successfully, but these errors were encountered: