Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing command line parameters 1

Status
Not open for further replies.

sproffitt

Technical User
Dec 23, 2000
2
0
0
US
I am very new to programming, so please forgive this rudimentary question...I am writing a utility that I would like to be able to pass a command line parameter at startup. I am using the ActivePERL port for WIN32. I am envisioning something such as the following for the CLI:

>perl ./myutil.pl parameter

and in my app I want to be able to assign a variable to the parameter. Such as:

$cliparm = parameter

I have tried using <STDIN>, but it is waits for user input &amp; thus doesn't accomplish what I want to. I want this to be seamless to the user.

Any suggestions will be most appreciated!

Thanks,
Stuart
 
@ARGV holds all your parameters, but if you want to use only one, this works..


$parameter = shift; adam@aauser.com
 
Your solution worked great!! Thank you for your help.

-Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top