in reply to if/while/else problem

Exactly... a while statement cannot have an else clause. Adding a single "}" at just the right place (and removing one that is now in the wrong place) should make Perl very happy again.

Bearing in mind that “you are among friends,” for we have all done it, you may now slap your forehead and repeat after me:   “DOH!!” :-D

Replies are listed 'Best First'.
Re: if/while/else problem
by ddrew78 (Beadle) on Mar 25, 2009 at 18:59 UTC
    DOH!! DOH!! :-) You were correct...however, even after making the change it did not fix my issue
      Your "issue" was that you were getting a syntax error. You now have a new issue because your syntax error is resolved. What you have now is a logic error. Unfortunately it's difficult for me to help you debug when all the code isn't here. However, something jumps out at me... -s file - "file" is a bare word, are you using strict? You probably want -s "file" or -s $file or something.