Path: utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!se12 From: se12@cs.vu.nl (Software Engin 91) Newsgroups: comp.lang.perl Subject: Novice problem: why is this a syntax error? Summary: perl doesn't expect my "else" Keywords: if, then, else, help, novice Message-ID: <8067@star.cs.vu.nl> Date: 29 Oct 90 11:40:43 GMT Sender: news@cs.vu.nl Lines: 18 RTFM'd, but couldn't find why perl said: syntax error at line 33: `else' unexpected. at this fragment: # Now, what is the main module anyway? if ($#ARGV >= 0) { $mainbase = $ARGV[0]; } else { $mainbase = "Main.mod"; } <<< this is line 33 $mainbase =~ s/\.mod$//o; $mainfile = $mainbase.".mod"; Sorry for this very stupid question, but this is my first perl script that should actually do something useful (a Makefile generator for Modula-2). - Gerben.