Re: Help with understanding references to subroutines

Discussion in 'Perl Misc' started by George Mpouras, Jan 5, 2014.

  1. Στις 4/1/2014 21:40, ο/η Dave Stratford έγÏαψε:
    > use Data::Dump 'pp'



    you could just say

    sub call_sub
    {
    $_[0]->()
    }


    I use very often subroutine references usually stored as hash values to
    eliminate my if/elsif/else statements and make my scripts a lot smaller
    George Mpouras, Jan 5, 2014
    #1
    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. ReaprZero

    References and subroutines

    ReaprZero, Dec 4, 2003, in forum: Perl
    Replies:
    1
    Views:
    438
    Gunnar Hjalmarsson
    Dec 4, 2003
  2. Ketema

    References Subroutines and Arrays

    Ketema, Mar 5, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    136
  3. Rainer Weikusat
    Replies:
    1
    Views:
    122
    Rainer Weikusat
    Jan 4, 2014
  4. Peter J. Holzer
    Replies:
    1
    Views:
    79
    Rainer Weikusat
    Jan 7, 2014
  5. Jürgen Exner
    Replies:
    9
    Views:
    88
    Charlton Wilbur
    Jan 13, 2014
Loading...

Share This Page