T
Todd Aceman
Hi folks.
Perhaps i'm being stupid about this, but can you tell me why this
isn't working...
I have a script called "x.pl", that's using Getopt::Long. The script
looks like this:
#!/usr/bin/perl
use Getopt::Long;
GetOptions (
"debug" => \$debug,
"silent" => \$silent );
print "DEBUG: $debug\n";
print "SILENT: $silent\n";
When i run this using "./x.pl --debug", As expected, i get the
following response:
% ./x.pl --debug
DEBUG: 1
SILENT:
When i run this using "./x.pl -d", i get the same response:
% ./x.pl -d
DEBUG: 1
SILENT:
So far, so good...
However, if i turn on bundling using "Getopt::Long::Configure (
'bundling' );", so that the script now reads:
#!/usr/bin/perl
use Getopt::Long;
Getopt::Long::Configure ( "bundling" );
GetOptions (
"debug" => \$debug,
"silent" => \$silent );
print "DEBUG: $debug\n";
print "SILENT: $silent\n";
And i try "./x.pl -ds", i get the following response:
% ./x.pl -ds
Unknown option: ds
DEBUG:
SILENT:
If i try just a single "-d" paramter, i still get an error:
% ./x.pl -d
Unknown option: d
DEBUG:
SILENT:
From reading the docs for Getopt::Long, it talks about bundling and
says that
For example, when vax, a, v and x are all valid options,
-vax
would set a, v and x...
However, when i try it. it doesn't work. Can someone tell me why
when i turn on "bundling", it stops accepting any parameters with a
single dash ("-") character?
This is perl 5.8.0 on Redhat Linux 9 (standard RPM distribution), and
also perl 5.8.0 on Windows XP using cygwin (the standard cygwin
distribution).
Thanks very much.
--tka.
Perhaps i'm being stupid about this, but can you tell me why this
isn't working...
I have a script called "x.pl", that's using Getopt::Long. The script
looks like this:
#!/usr/bin/perl
use Getopt::Long;
GetOptions (
"debug" => \$debug,
"silent" => \$silent );
print "DEBUG: $debug\n";
print "SILENT: $silent\n";
When i run this using "./x.pl --debug", As expected, i get the
following response:
% ./x.pl --debug
DEBUG: 1
SILENT:
When i run this using "./x.pl -d", i get the same response:
% ./x.pl -d
DEBUG: 1
SILENT:
So far, so good...
However, if i turn on bundling using "Getopt::Long::Configure (
'bundling' );", so that the script now reads:
#!/usr/bin/perl
use Getopt::Long;
Getopt::Long::Configure ( "bundling" );
GetOptions (
"debug" => \$debug,
"silent" => \$silent );
print "DEBUG: $debug\n";
print "SILENT: $silent\n";
And i try "./x.pl -ds", i get the following response:
% ./x.pl -ds
Unknown option: ds
DEBUG:
SILENT:
If i try just a single "-d" paramter, i still get an error:
% ./x.pl -d
Unknown option: d
DEBUG:
SILENT:
From reading the docs for Getopt::Long, it talks about bundling and
says that
For example, when vax, a, v and x are all valid options,
-vax
would set a, v and x...
However, when i try it. it doesn't work. Can someone tell me why
when i turn on "bundling", it stops accepting any parameters with a
single dash ("-") character?
This is perl 5.8.0 on Redhat Linux 9 (standard RPM distribution), and
also perl 5.8.0 on Windows XP using cygwin (the standard cygwin
distribution).
Thanks very much.
--tka.