Using perl to get options from command line

Hi all,
I want to get options from command line by perl.

usage()
 options:
                -h                    Show this help message and exit
                -t                     Name of tester [Required]
                --timeout           Set the timeout
                -l                      Log and Report output dir
                -r                      Alternative path to testcase scripts
                -s                      Specify the suits of testcases to run
                --testscripts           Specify the testscripts to run
                -p                      Specify the priority of the testcase to run
                -a                      remoteaddress
                -u                      remoteuser
                --remotepasswd          remotepassword
                -o                      Upgrade Framework config file or not

I wrote a perl as followsmy

    %options=(); 
    getopts("ot:l:r:s: p:a:u:",\%options);
    GetOptions("timeout=s"=> \$options{'timeout'},"testscripts=s@"=>\$options{'testscripts'},"remotepasswd=s"=>\$options{'remotepasswd'});

what's wrong with that?
when I run the script:

 ./aaa.pl -t Jack -l /logs/ -r /testscripts -s net -p 0 -a 10.22.11.22 -u damon -o

when I print all Options
it says

Option:
        tester: imeout=400
        timeout:
        logdir: /logs/
        sriptroot: emotepasswd=damon
        suits: net
        testscripts:
        priority: 0
        remoteaddress: 10.22.11.22
        remoteuser: damon
        remotepasswd:

what's wrong with that?
or can you give me a example using getopts and GetOptions?

Thanks
Damon

I've never used getopts. I don't like the concept.
But here's a piece of something I use that might work for you.

while ($_ = shift @ARGV) {
    /^--/ && s/^--/-/;
    SWITCH: {
        /^-skip/ && do {
            $skipcount = /=/ ? do { s/.*=//, $_ } : shift @ARGV;
            if ($skipcount =~ /\D/) {
                warn "ERROR: The skipcount isn't a number: $skipcount\n";
                exit 1;
            }
            last SWITCH;
        };
        /^-max/ && do {
            $maxcount = /=/ ? do { s/.*=//, $_ } : shift @ARGV;
            if ($maxcount =~ /\D/) {
                warn "ERROR: The maxcount isn't a number: $maxcount\n";
                exit 1;
            }
            last SWITCH;
        };
        /^-n$/ && do { $just_print = 1;   last SWITCH; };
        /^-v$/ && do { $verbose = 1;      last SWITCH; };
        /^-./ && do {
            warn "WARNING: Ignoring unknown switch $_\n";
            sleep 100;
            last SWITCH;
        };
        if ($filename ne "-") {
            warn "ERROR: Too many files\n";
            exit 1;
        }
        $filename = $_;
    }
}