Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 pondering the Monastery: (14)
As of 2014-11-25 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (158 votes), past polls