Subroutine definition

Discussion in 'Perl' started by Gunnar Hjalmarsson, Jun 11, 2004.

  1. Bryon Bean wrote:
    > I was checking out some modules for introspection and while looking
    > at the code for MRP::Introspection I noticed this subroutine
    > definition that I've never seen before (well not in perl at least).
    > I was wondering if someone could explain to me what it meant?
    > TIA...
    >
    > sub some_function( $ ){
    > ...
    > }


    Read about prototypes in "perldoc perlsub".

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Jun 11, 2004
    #1
    1. Advertising

  2. Gunnar Hjalmarsson

    Bryon Bean Guest

    Hello,

    I was checking out some modules for introspection and while looking at the
    code for MRP::Introspection I noticed this subroutine definition that I've
    never seen before (well not in perl at least). I was wondering if someone
    could explain to me what it meant? TIA...

    sub some_function( $ ){
    ....
    }

    --
    ________________________________________
    In heaven all the interesting people are missing.
    --Friedrich Nietzsche
     
    Bryon Bean, Jun 11, 2004
    #2
    1. Advertising

  3. Gunnar Hjalmarsson

    Jim Gibson Guest

    In article <>, Bryon Bean
    <> wrote:

    > Hello,
    >
    > I was checking out some modules for introspection and while looking at the
    > code for MRP::Introspection I noticed this subroutine definition that I've
    > never seen before (well not in perl at least). I was wondering if someone
    > could explain to me what it meant? TIA...
    >
    > sub some_function( $ ){
    > ...
    > }


    It declares the subroutine as taking a single scalar as argument. See
    "perldoc perlsub" and read about prototypes.

    This newsgroup is defunct. Try comp.lang.perl.misc in the future.
     
    Jim Gibson, Jun 17, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jianli Shen
    Replies:
    1
    Views:
    608
    Victor Bazarov
    Mar 13, 2005
  2. Ark
    Replies:
    1
    Views:
    440
    Chris Torek
    Aug 7, 2004
  3. Jon Slaughter
    Replies:
    4
    Views:
    461
    Jon Slaughter
    Oct 26, 2005
  4. Pierre Yves
    Replies:
    2
    Views:
    504
    Pierre Yves
    Jan 10, 2008
  5. king
    Replies:
    5
    Views:
    205
Loading...

Share This Page