Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!etnibsd!vsh From: vsh@etnibsd.UUCP (Steve Harris) Newsgroups: comp.lang.perl Subject: do BLOCK bug? Message-ID: <1137@etnibsd.UUCP> Date: 1 Aug 90 20:24:31 GMT Organization: Eaton Corp, Semiconductor Equipment Div., Beverly, MA Lines: 28 I'm running perl 3.0, patchlevel 15. Apologies if this issue has already been addressed in this newsgroup and/or if it is fixed in a more recent patch. If I run the following code, which is taken directly from the manual (the section describing the lack of a switch statement): foo: { /^abc/ && do { $abc = 1; last foo; } /^def/ && do { $def = 1; last foo; } /^xyz/ && do { $xyz = 1; last foo; } $nothing = 1; } I get the following errors: syntax error in file t.pl at line 3, next token "/^def/" syntax error in file t.pl at line 5, next token "$nothing" Execution aborted due to compilation errors. The errors go away if I place a semicolon after each do BLOCK (presumably the do BLOCK is expecting an optional modifier, e.g.:) do BLOCK if EXPR; This looks like a bug, in the documentation if nowhere else. -- Steve Harris - Eaton Corp. - Beverly, MA - uunet!etnibsd!vsh