Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6348799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:29:36+00:00 2026-05-24T21:29:36+00:00

I’m reading Beginning Perl by Simon Cozens and in Chapter 8 – Subroutines he

  • 0

I’m reading Beginning Perl by Simon Cozens and in Chapter 8 – Subroutines he states that “subroutines” are user functions, while print, open, split, etc. are built-in operators or functions.

What are they? Are they really built-in, language-intrinsic features (like C’s sizeof operator) or are they, actually, subroutines/functions of the main module?

If they’re subroutines, are while, for, unless, etc. also subroutines? What about the operators like +, -, eq, etc.?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:29:37+00:00Added an answer on May 24, 2026 at 9:29 pm

    print, open, split are not subroutines. They do not result in sub calls. They are not even present in the symbol table (in main:: or otherwise, although you can refer to them as CORE::split, etc), and one cannot get a reference to their code (although work is being done to create proxy subs for them in CORE:: for when you want to treat them as subroutines). They are operators just like +.

    $ perl -MO=Concise,-exec -e'sub f {} f()'
    1  <0> enter 
    2  <;> nextstate(main 2 -e:1) v:{
    3  <0> pushmark s
    4  <#> gv[*f] s
    5  <1> entersub[t3] vKS/TARG,1      <--- sub call
    6  <@> leave[1 ref] vKP/REFC
    -e syntax OK
    
    $ perl -MO=Concise,-exec -e'split /;/'
    1  <0> enter 
    2  <;> nextstate(main 1 -e:1) v:{
    3  </> pushre(/";"/) s/64
    4  <#> gvsv[*_] s
    5  <$> const[IV 0] s
    6  <@> split[t2] vK                 <--- not a sub call
    7  <@> leave[1 ref] vKP/REFC
    -e syntax OK
    
    $ perl -MO=Concise,-exec -e'$x + $y'
    1  <0> enter 
    2  <;> nextstate(main 1 -e:1) v:{
    3  <#> gvsv[*x] s
    4  <#> gvsv[*y] s
    5  <2> add[t3] vK/2                 <--- Just like this
    6  <@> leave[1 ref] vKP/REFC
    -e syntax OK
    

    They are known by a variety of names:

    • builtin functions
    • functions
    • builtins
    • named operators

    And most are considered to be one of the following:

    • list operator
    • named unary operator

    Subroutines are often called functions (as they are in C and C++), so “function” is an ambiguous word. This ambiguity appears to be the basis of your question.


    As for while, for, unless, etc, they are keywords used by flow control statements

    while (f()) { g() }
    

    and statement modifiers

    g() while f();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.