illuzian
asked on
Perl Getopt::Long - Error in option spec
I'm trying to run a script I wrote on a Linux Box on an AIX machine but it seems to error our, it works flawlessly on Linux and the syntaxt looks fine but when I run it on the aix box I get:
Error in option spec: "z|zcat|zip|compressed:s{2 }"
Error in option spec: "t|text:s{2}"
Any help would be valued.
Cheers
Error in option spec: "z|zcat|zip|compressed:s{2
Error in option spec: "t|text:s{2}"
Any help would be valued.
Cheers
#!/usr/bin/perl
use Getopt::Long;
$tmpfile = "/u/oper/ahawkes/tmp/\$USER.txt";
print "\n";
my ($help, @compressed, @text);
##### get options #####
usage() if ( ! GetOptions('help|?' => \$help, 'z|zcat|zip|compressed=s{2}' => \@compressed, 't|text:s{2}' => \@text, )
or defined $help );
###---code continues---###
what version of Getopt::Long do you have?
ASKER
Version is 2.34
Try double quotes:
usage() if ( ! GetOptions("help|?" => \$help, "z|zcat|zip|compressed=s{2
or defined $help );
ASKER
Double quotes still comes up with an error in option spec
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If an upgrade of the AIX box is not an option can anyone think of an alternative way of achieving the desired result?
You could iterate over the array looking to see if the option is valid using grep...