Piers Cawley wrote:

> So, the new rule for blocks and when the need semicolons seems to be
> "You don't need a semicolon if the block is the last argument of a
> subroutine which expects a block as its last argument", which is all
> very well and all, but ... Ah... hang on, that's *expression* not
> statement, so that should parse ... fine. 
> 
> Am I worrying unduly about nothing?
> 
> What was my question? Argh! I'm more confused now then when I started
> this message...

I'm wondering how implied semicolons will interact with statement
modifiers.[*0]  This is Damian's example of calling a user-defined sub
without a trailing semicolon:

  perhaps $x<$y, 0.25 { print "Happened to be less than\n"}

Presumably it's valid to put a statement modifier on such a line (with a
semicolon after it, obviously):

  perhaps $x < $_, 0.4 { print "Smaller\n"} for @max;

Presumably it's also possible to have such a line (without a statement
modifier) with a for loop as the following statement, and for that loop
to use the new syntax for iterating through multiple lists in parallel:

  perhaps $x < $_, 0.4 { print "Smaller\n"}
  for @max; @min -> $top; $bottom
  {
    # etc
  }

How are these two cases distinguished from each other?

Since whitespace is interchangeable, the second fragment could be
formatted like this to make it look even more like the first:

  perhaps $x < $_, 0.4 { print "Smaller\n"} for @max;
  @min -> $top; $bottom
  {
    # etc
  }

I'm scared.  

[*0]  I actually tried to wonder this on this list last week.  As I'm
not subscribed I thought that posting through the newsgroup interface
would be the best way of keep threading.  I tried posting through Google
Groups.  My article showed up there (see link below), but doesn't seem
to have filtered through to other places.  Is it supposed to?

I'm posting this with a newsreader rather than a web-browser so
hopefully it'll get through.  Apologies to anybody who got it twice.

  
http://groups.google.co.uk/groups?hl=en&ie=UTF-8&oe=UTF-8&threadm=d7c367d5.0209051022.9ba6bea%40posting.google.com&rnum=1

Smylers

Reply via email to