Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2022-08-12 18:49 GMT
Find Nodes?
    Voting Booth?

    No recent polls found