[Pugs] Semicolon as statement terminator

7 views
Skip to first unread message

Andrew Savige

unread,
Mar 26, 2005, 1:31:15 AM3/26/05
to perl6-c...@perl.org
I was flabbergasted by this one.

# cat weird.p6
my$x=42my$y="Zaphod"~"Beeblebrox"my$z="I think they're just
strange symbols of some kind"say"x='$x' y='$y' z='$z'"

# pugs weird.p6
x='42' y='ZaphodBeeblebrox' z='I think they're just
strange symbols of some kind'

Wow! It actually seems to work.
Are semicolons as statement terminators optional in Perl 6?
A cursory reading of the Synopses, I couldn't find a clear definition
of precisely what is a "statement" (c.f. in C, where "an expression
becomes a statement when it is followed by a semicolon").

/-\


Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

Luke Palmer

unread,
Mar 26, 2005, 1:45:51 AM3/26/05
to Andrew Savige, perl6-c...@perl.org
Andrew Savige writes:
> I was flabbergasted by this one.
>
> # cat weird.p6
> my$x=42my$y="Zaphod"~"Beeblebrox"my$z="I think they're just
> strange symbols of some kind"say"x='$x' y='$y' z='$z'"
>
> # pugs weird.p6
> x='42' y='ZaphodBeeblebrox' z='I think they're just
> strange symbols of some kind'
>
> Wow! It actually seems to work.
> Are semicolons as statement terminators optional in Perl 6?

Semicolons have the exact same status as in Perl 5, except for some
special cases about closing braces. So no, that should not work.

Luke

Autrijus Tang

unread,
Mar 26, 2005, 2:51:16 AM3/26/05
to Andrew Savige, perl6-c...@perl.org
On Sat, Mar 26, 2005 at 05:31:15PM +1100, Andrew Savige wrote:
> I was flabbergasted by this one.
>
> # cat weird.p6
> my$x=42my$y="Zaphod"~"Beeblebrox"my$z="I think they're just
> strange symbols of some kind"say"x='$x' y='$y' z='$z'"

Thanks, fixed in r1192.

Enjoy,
/Autrijus/

Reply all
Reply to author
Forward
0 new messages