#!/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

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^2: Processing command line based on user input by afoken
in thread Processing command line based on user input by iphone

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.