Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: My problems to understand the Perl documentation

by jo37 (Hermit)
on Aug 23, 2020 at 19:42 UTC ( #11121013=note: print w/replies, xml ) Need Help??


in reply to Re^2: My problems to understand the Perl documentation
in thread My problems to understand the Perl documentation

My conclusion from this is that split is a Perl sub, without prototype.

Is there any built-in without a prototype? I don't think so.

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
  • Comment on Re^3: My problems to understand the Perl documentation

Replies are listed 'Best First'.
Re^4: My problems to understand the Perl documentation
by LanX (Sage) on Aug 23, 2020 at 21:52 UTC
    > Is there any built-in without a prototype? I don't think so.

    Yes, several.

    You can check yourself with prototype

    From the docs:

    If FUNCTION is a string starting with CORE:: , the rest is taken as a name for a Perl builtin.

    If the builtin's arguments cannot be adequately expressed by a prototype (such as system), prototype returns undef, because the builtin does not really behave like a Perl function.

    Otherwise, the string describing the equivalent prototype is returned.

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

Re^4: My problems to understand the Perl documentation
by haukex (Bishop) on Aug 24, 2020 at 07:31 UTC
    Is there any built-in without a prototype?

    On 5.28, prototype returns undef for at least the following (I may have missed a few, and I omitted most things that I think most people would classify as keywords and operators instead of functions, like use, goto, and -X):

    chomp chop defined delete do eval exec exists grep map print printf require return say select sort split system

    Added minor clarifications.

      > most people would classify as keywords and operators instead of functions

      For me any reserved word is a keyword, this includes functions.

      I know what you mean but "keyword" doesn't describe it.

      See also perlfunc#Perl-Functions-by-Category ... which is even more confusing.

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

        Yes, good point, I was thinking of e.g. if and for, but I didn't list goto but did list return - now that I think about it some more, I probably shouldn't have listed the latter because it can't really be approximated by a sub (that's how I personally generally differentiate between "functions" and "operators" in Perl, but this isn't perfect and a pretty big grey area).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2022-05-26 02:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (92 votes). Check out past polls.

    Notices?