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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active PERL: How to take a parameter?

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I set perl.exe as my command line intrepreter for all files with .pl extension. Therefore:
c:\> namgor.pl
[works fine]..however

c:\> namgor.pl param1 param2
[doest take in parameters]

Any ideas how to fix it? This is Windows2000
 
Hi there,

I pick up command line parameters like this:


-- snip --
$param1 = shift or die "First Parameter not found\n";
$param2 = shift or die "Second Parameter not found\n";
-- snip --

is this what isn't working for you?

Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
You can also pick up command line parameters from the @ARGV array.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top