Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Question about ellipsis statement '...'

by shmem (Chancellor)
on Mar 01, 2021 at 14:58 UTC ( #11128952=note: print w/replies, xml ) Need Help??


in reply to Question about ellipsis statement '...'

There are two uses for '...' - as:

  1. part of an expression - see Range Operators
  2. statement on its own - equivalent to die "Unimplemented"; - see The Ellipsis Statement

And so...

I don't understand why '...; print 1;' exits after ellipsis and not proceeds to print (v5.28). Can someone explain?

The sequence ...; print 1; does not proceed to print, because it dies before the print, just at the ...;

I understand why 'print ...' breaks: because it makes syntax error.

Yes. Because it is not a statement on its own, it is interpreted as the infix range operator, which lacks arguments - so "syntax error".

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11128952]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2021-04-11 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?