Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Why does eof have a prototype?

by LanX (Sage)
on Aug 07, 2022 at 21:49 UTC ( #11146009=note: print w/replies, xml ) Need Help??


in reply to Re^3: Why does eof have a prototype?
in thread Why does eof have a prototype?

> It's also worth noting that AFAIK eof is the only function in Perl that behaves this way... the exception that confirms the rule ;-)

well yes, each magic exception is different, look at chop (LIST) , which has no prototype.

> look at threads like Prototype like sort()?

But sort has no prototype, that's my point.

> All of eof's syntax can be replicated, but not its functionality.

well your link to tie made me thinking ...

I remember that overriding say or print was only possible by tieing the connected file-handles, so maybe eof IS fully overridable in the end, thanks to that extra magic.

I'll try tomorrow.

> but I think you should cut the authors some slack :-)

One of the reasons why Perl is now so unpopular in academia are surprising and frustrating exceptions. Clarifying and rectifying such things would help to make Perl more orthogonal and acceptable.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2023-02-06 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (37 votes). Check out past polls.

    Notices?