Another problem (that isn't with your Getopt::Long), is with your shell scripting. If you want to pass all arguments through to a command in a shell script, it's done like:
rather thancommand "$@"
The difference can be demonstrated if you just take this simple shell script (lets call it "test.sh"):command $*
and call it with some arguments that will demonstrate why this breaks:#!/bin/sh perl -e "use Data::Dumper; print Dumper \@ARGV" $*
but if we change test.sh to:[sstone@ernie1 scratch]$ sh test.sh 1 2 "3 and more stuff" $VAR1 = [ 1, 2, 3, 'and', 'more', 'stuff' ]; [sstone@ernie1 scratch]$
and run it the same way:#!/bin/sh perl -e "use Data::Dumper; print Dumper \@ARGV" "$@"
The difference being that "$@" will preserve the arg list as a list, whereas $* will flatten it all into a string (basically just like join(" ",@ARGV)), and then split it on whitespace... so if you had args with whitespace in them it would get all messed up.[sstone@ernie1 scratch]$ sh test.sh 1 2 "3 and more stuff" $VAR1 = [ 1, 2, '3 and more stuff' ]; [sstone@ernie1 scratch]$
At the very least, that's a couple of things that might be causing you problems.
------------ :Wq Not an editor command: Wq
In reply to Re: problem with Getopt::Long
by etcshadow
in thread problem with Getopt::Long
by syedtoah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |