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!

How to pass arguments

Status
Not open for further replies.

komark

Technical User
Sep 12, 2005
134
US
Hi,

I am trying to pass an argument/option in the command line when calling my perl program. The argument/option should call only certain part of my program.

Can anyone help me figure this out?

Thanks
Omar.
 
Command-line arguments come in as the array @ARGV.

Use a module like Getopt::Long for some easy access to using --named --options to your script like all the other command-line apps have.

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top