Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Question about ellipsis statement '...'

by shmem (Chancellor)
on Mar 01, 2021 at 14:58 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11128952]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2024-04-18 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found