Oct 28, 2000 #1 mackiew Programmer Sep 15, 2000 18 UY Hello ! I have a perl program called myPerlProgram. I want pass a parameter myParameter (scalar) to it as: comandLine> myPerlProgram myParameter <Enter> What code must I include in myPerlProgram to catch myParameter into the program? How I do it?? Thanks !
Hello ! I have a perl program called myPerlProgram. I want pass a parameter myParameter (scalar) to it as: comandLine> myPerlProgram myParameter <Enter> What code must I include in myPerlProgram to catch myParameter into the program? How I do it?? Thanks !
Oct 28, 2000 #2 MikeLacey MIS Nov 9, 1998 13,212 GB hi mac, [tt] my $arg = shift or die "No argument specified\n"; print "Argument was $arg\n"; [/tt] Mike michael.j.lacey@ntlworld.com http://www.cargill.com/ Upvote 0 Downvote
hi mac, [tt] my $arg = shift or die "No argument specified\n"; print "Argument was $arg\n"; [/tt] Mike michael.j.lacey@ntlworld.com http://www.cargill.com/
Nov 8, 2000 #3 luciddream Programmer Nov 8, 2000 712 US all arguments passed to a program are stored in the @ARGV array. shift is a great way to get an argument, but, if you are working with multiple arguments, its nice to know that they're in @ARGV. Upvote 0 Downvote
all arguments passed to a program are stored in the @ARGV array. shift is a great way to get an argument, but, if you are working with multiple arguments, its nice to know that they're in @ARGV.