diff --git a/Changes b/Changes index 9e084598cb..8a2b7b5f3f 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ This file documents the revision history for Perl extension Mojo. - Made proxy support more portable. - Simplified progress callbacks. - Cleaned up internal Mojo APIs. + - Fixed dependency on Getopt::Long 2.38. (kevinold) 0.991242 2009-07-27 00:00:00 - Cleaned up the whole script system, this change is mostly backwards diff --git a/lib/Mojo.pm b/lib/Mojo.pm index 19534044c5..299f492ca7 100755 --- a/lib/Mojo.pm +++ b/lib/Mojo.pm @@ -182,6 +182,8 @@ Jesse Vincent Kazuhiro Shibuya +Kevin Old + Lars Balker Rasmussen Leon Brocard diff --git a/lib/Mojo/Script/Cgi.pm b/lib/Mojo/Script/Cgi.pm index 3c2a3c1e13..b790b5a1a1 100644 --- a/lib/Mojo/Script/Cgi.pm +++ b/lib/Mojo/Script/Cgi.pm @@ -9,7 +9,7 @@ use base 'Mojo::Script'; use Mojo::Server::CGI; -use Getopt::Long 'GetOptionsFromArray'; +use Getopt::Long 'GetOptions'; __PACKAGE__->attr('description', default => <<'EOF'); Start application with CGI backend. @@ -27,8 +27,8 @@ sub run { my $cgi = Mojo::Server::CGI->new; # Options - my @options = @_ ? @_ : @ARGV; - GetOptionsFromArray(\@options, 'nph' => sub { $cgi->nph(1) }); + @ARGV = @_ if @_; + GetOptions('nph' => sub { $cgi->nph(1) }); # Run $cgi->run; diff --git a/lib/Mojo/Script/Daemon.pm b/lib/Mojo/Script/Daemon.pm index cc947a0618..d3981a8cac 100644 --- a/lib/Mojo/Script/Daemon.pm +++ b/lib/Mojo/Script/Daemon.pm @@ -9,7 +9,7 @@ use base 'Mojo::Script'; use Mojo::Server::Daemon; -use Getopt::Long 'GetOptionsFromArray'; +use Getopt::Long 'GetOptions'; __PACKAGE__->attr('description', default => <<'EOF'); Start application with HTTP 1.1 backend. @@ -37,9 +37,8 @@ sub run { my $daemon = Mojo::Server::Daemon->new; # Options - my @options = @_ ? @_ : @ARGV; - GetOptionsFromArray( - \@options, + @ARGV = @_ if @_; + GetOptions( 'clients=i' => sub { $daemon->max_clients($_[1]) }, 'group=s' => sub { $daemon->group($_[1]) }, 'keepalive=i' => sub { $daemon->keep_alive_timeout($_[1]) }, diff --git a/lib/Mojo/Script/DaemonPrefork.pm b/lib/Mojo/Script/DaemonPrefork.pm index 4f46d863d8..1c36cbbb2f 100644 --- a/lib/Mojo/Script/DaemonPrefork.pm +++ b/lib/Mojo/Script/DaemonPrefork.pm @@ -9,7 +9,7 @@ use base 'Mojo::Script'; use Mojo::Server::Daemon::Prefork; -use Getopt::Long 'GetOptionsFromArray'; +use Getopt::Long 'GetOptions'; __PACKAGE__->attr('description', default => <<'EOF'); Start application with preforking HTTP 1.1 backend. @@ -51,9 +51,8 @@ sub run { # Options my $daemonize; - my @options = @_ ? @_ : @ARGV; - GetOptionsFromArray( - \@options, + @ARGV = @_ if @_; + GetOptions( 'clients=i' => sub { $daemon->max_clients($_[1]) }, 'daemonize' => \$daemonize, 'group=s' => sub { $daemon->group($_[1]) },