Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: GetOptions Function NOT Assign CLI Args to Variables?

by frozenwithjoy (Curate)
on Oct 12, 2012 at 18:08 UTC ( #998762=note: print w/ replies, xml ) Need Help??


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


Comment on Re: GetOptions Function NOT Assign CLI Args to Variables?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998762]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2015-07-06 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls