Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Is it possible to use a scalar to call a subroutine?

by kennethk (Abbot)
on May 06, 2010 at 16:55 UTC ( [id://838756]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    use warnings;
    ...
    }
    __END__
    My name is Fred
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    use warnings;
    ...
    print $dispatch_table{$sub_name}("Fred");
    __END__
    My name is Fred
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found