Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!olivea!oliveb!veritas!amdcad!sono!porky!mayer From: mayer@sono.uucp (Ronald &) Newsgroups: comp.lang.perl Subject: Re: using perl interactively [summary and more questions] Message-ID: Date: 24 May 91 21:23:54 GMT Sender: mayer@sono.uucp (Ronald Mayer) Distribution: comp Organization: ACUSON, Mountain View, CA Lines: 30 [In a recent email message I asked for a more user-friendly interactive interface with access to perl commands kinda like a combination of perl, a shell, and a calculator. In this message a was asking for a method to determine whether a line of input entered by the user contains a syntax error of if it is potentially part of a valid multi-line perl statement.] All responses I recieved told me that the best way they knew of to determine this is to '$@ =~ /at EOF/'. While this works fine for some programming styles, it fails for others. i.e. eval 'for $i (1..10) {' # ($@ =~ /at EOF/) == TRUE eval 'for $i (1..10)' # ($@ =~ /at EOF/) == FALSE The source of my difficulty seems to be related to the fact that eval appends a ';' to the end of the string before evaling it. Is it really necessary for eval to do this? Is there a way to turn off this feature? Ron Mayer mayer@sono.uucp sun!sono!mayer