perlでコマンドラインオプションの処理方法

use Getopt::Long;

my $opt_all = 0;
my $opt_debug = 0;

GetOptions('all' => \$opt_all, 'debug' => \$opt_debug);

print "\$opt_all: $opt_all\n";
print "\$opt_debug: $opt_debug\n";