#!/usr/bin/env perl
use strict;
use warnings;
use locale;
my $prepinac_r = '';
my $array_name = '';
use Getopt::Long;
Getopt::Long::Configure ("bundling");
my $result = GetOptions(
"r=s" => \$prepinac_r,
"array-name=s" => \$array_name);
print STDERR "r: $prepinac_r\n";
print STDERR "array_name: $array_name\n";
運行它:
script.pl --array-name=kokos -r=kure
輸出:
r: =kure
array_name: kokos
我做錯了嗎?我錯過了什麼?爲什麼-r獲得「= kure」而不是「kure」?請幫助...
Getopt :: Long :: Configure(「bundling_override」); – rluks 2012-04-07 07:42:35