Skip Menu |
 

This queue is for tickets about the Nmap-Parser CPAN distribution.

Report information
The Basics
Id: 86674
Status: new
Priority: 0/
Queue: Nmap-Parser

People
Owner: Nobody in particular
Requestors: mz [...] leasingborsen.dk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Change request
Date: Wed, 03 Jul 2013 15:54:49 +0200
To: bug-Nmap-Parser [...] rt.cpan.org
From: Michael Zedeler <mz [...] leasingborsen.dk>
Download (untitled) / with headers
text/plain 885b
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.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.