CColin has asked for the wisdom of the Perl Monks concerning the following question:
Then, at the point in the program when I want to use the sub, callmy $generic_sub ="name of sub to use"
Problem: using strict this throws the error:$return value = &$generic_sub(arguments)
I've read the perlref docs about using references to name subroutines, but that doesn't seem to solve the problem, in that I still need to use the name of the string from the input file to determine which subroutine to use, whether that subroutine is referred to by a reference or not. And it is the use of the string as a subroutine ref that is causing the error, right? Thanks for any pointers. ColinCan't use string ("name of sub") as a subroutine ref while "strict ref +s" in use at program_name_1.0 line 153.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: subroutine refs
by wfsp (Abbot) on Nov 30, 2007 at 10:47 UTC | |
|
Re: subroutine refs
by moritz (Cardinal) on Nov 30, 2007 at 10:42 UTC | |
|
Re: subroutine refs
by fenLisesi (Priest) on Nov 30, 2007 at 13:15 UTC | |
|
Re: subroutine refs
by locked_user sundialsvc4 (Abbot) on Nov 30, 2007 at 16:33 UTC | |
|
Re: subroutine refs
by broquaint (Abbot) on Nov 30, 2007 at 18:19 UTC | |
by blokhead (Monsignor) on Nov 30, 2007 at 18:50 UTC | |
by HelenCr (Monk) on Sep 14, 2013 at 11:44 UTC | |
by Athanasius (Archbishop) on Sep 15, 2013 at 06:45 UTC | |
|
Re: subroutine refs
by Anonymous Monk on Nov 30, 2007 at 16:17 UTC | |
|
Re: subroutine refs
by Anonymous Monk on Nov 30, 2007 at 21:15 UTC | |
by lancer (Scribe) on Jul 25, 2015 at 14:03 UTC |