Skip Menu |

This queue is for tickets about the Getopt-Long CPAN distribution.

Report information
The Basics
Id: 32831
Status: rejected
Priority: 0/
Queue: Getopt-Long

People
Owner: Nobody in particular
Requestors: colin.fine [...] pace.co.uk
Cc:
AdminCc:

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



Subject: Unhelpful prototype for GetOptionsFromArray
I had wrapped Getopt::Long::GetOptionsFromArray in a function of my own with the same spec, and wanted to pass @_ on to it. (i.e. the array argument was already in the argument list as $_[0]). So I naturally wrote $ret = Getopt::Long::GetOptionsFromArray(@_0); and was very puzzled when it died with " Can't use string ("19") as an ARRAY ref while "strict refs" in use at /usr/lib/perl5/5.8.8/Getopt/Long.pm line 497, <CVSRC> line 2." Even with the perl debugger I couldn't see what was going on, until I thought of prototypes, and saw that the function was declared as sub GetOptionsFromArray($@); I can sort of see why this was done; but I don't think it's really helpful. It will let people write the call without ( ), but the cost is that I had a strange and incomprehensible error, which I could not fix without looking at the code. I want to suggest that this prototype should be simplified to '@'. That is less precise than it need be, but I don't think you'll lose anything by it.
I appreciate that you may have reasons to reject my request, but to mark it as 'resolved' without any comment is, to say the least, impolite. If you are not accepting my suggestion, please explain why.
My mistake. Should have added "Fixed in 2.37_03".
On Tue Sep 09 04:15:28 2008, JV wrote: Show quoted text
> My mistake. Should have added "Fixed in 2.37_03". >
Oh right. Thanks.