Yes, you're missing a bracket at the end of the line. :-) Syntax errors aside (use the -w switch to avoid the problem jeroenes pointed out), I don't think anything's wrong with what you wrote, in principle. I can't get Getopt::Std::getopt() to work either (I'm not sure what's up with that--possibly we're both idiots), but if you use getopts() (note the s) instead, it should work (assuming, of course, that your syntax checks out otherwise ;-).

If you like use strict; (and you should), try the two-argument syntax that azatoth mentions (check the docs for how), so you don't have to declare a variable for every switch.

Update:
I got so excited about getopt that I forgot the main point: check the return value of the whichever function you use to see if it's failing (returns a true value if it works normally).
Correction: <blush>
only check the return value of getopts(), getopt() always returns false.

Update 2:
The source of your original problem was probably that getopt() expects all flags to have arguments (e.g. -e1 or -e 1), not be booleans (-e): getopts() allows for both. Which I should have pointed out earlier, sorry.



If God had meant us to fly, he would *never* have give us the railroads.
    --Michael Flanders


In reply to Re: Re: Begining Monk seeks Wisdom....... by ChemBoy
in thread Begining Monk seeks Wisdom....... by void

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.