[Israel.pm] new module for CPAN: Getopt::Long::String

Mikhael Goikhman migo at homemail.com
Mon Jan 30 03:48:38 PST 2006

On 30 Jan 2006 11:21:24 +0200, Levenglick Dov-RM07994 wrote:
> How do we feel about this version (and thanks to Yuval on this most useful module)? It seems to address the main problem of multi-worded strings in $string.
> package Getopt::Long::String;
> use 5.004;
> use Exporter;
> use Getopt::Long;
> use String::Escape qw( string2list);
> use strict;
> sub GetOptions {
> 	local @ARGV = string2list(shift);
> 	return &Getopt::Long::GetOptions;
> }

I think, it should be "goto", not "return". I mean, calling
Getopt::Long::GetOptions() without parameters seems useless to me.
And you should probably export your function, like Getopt::Long does.

Well, having this functionality would mean installing 2 new modules for
me, since String::Escape is not in the core perl. And personally I don't
really need this. I usually either already have an array of options
(just not necessarily in @ARGV) or should parse the command line myself
(string2list is good in many cases, but not all). I guess I need one
more trivial module Getopt::Long::Array for this. ;)

This is certainly not to deny that your module may be useful for certain
things. However enhancing Getopt::Long is possibly a better idea (just
don't add explicit compile time dependancy on String::Escape to it).


perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'

More information about the Perl mailing list