in reply to Re: Processing command line based on user input
in thread Processing command line based on user input
#!/usr/bin/perl use strict; use warnings; ##arguments chomp(my $first_arg = $ARGV[0]); chomp(my $second_arg = $ARGV[1]); ###check the arguments are correct if($first_arg ne "something") { #print some errors } if($second_arg ne "something") { #print some errors } ##execute the exe findfile.exe $first_agr $second_arg
Did you actually try to run this nonsense? It won't even compile!
perl 872641.pl Global symbol "$first_agr" requires explicit package name at 872641.pl + line 24. Bareword "findfile" not allowed while "strict subs" in use at 872641.p +l line 24. Execution of 872641.pl aborted due to compilation errors.
chomping the arguments does not make any sense. External programs aren't executed by just writing their filename into the script. And even if they would, you would pass just the first two arguments to the external program, not all arguments as required. iphone explicitly asked for at least four arguments. And when called with less than two arguments, the external program would still be invoked with two arguments, one or both being empty strings.
Please stop posting such junk, it will only frustrate people searching for help. Test your code before posting it.
Alexander
|
|---|