http://www.perlmonks.org?node_id=998762


in reply to GetOptions Function NOT Assign CLI Args to Variables?

You need to tell Getopt what options your are assigning using single or double dashes (-option or --option). Run it like this:

./test_perl.pl --ipAddr 192.168.1.1 --server 192.168.5.1

The output I get from running it this way:

@ARGV: "--ipAddr 192.168.1.1 --server 192.168.5.1" GETTING OPTIONS... IP Address = 192.168.1.1 SERVER Address = 192.168.5.1