halfcountplus has asked for the wisdom of the Perl Monks concerning the following question:
How can I use a variable to call a subroutine with "use strict"? eg.
#!/usr/bin/perl -w #use strict; my $ref="this"; my $x=&$ref(); print "$x\n"; sub this {return "hi!"}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: variable reference to subroutine while "strict"
by FunkyMonk (Bishop) on Apr 13, 2008 at 18:00 UTC | |
by halfcountplus (Hermit) on Apr 13, 2008 at 20:46 UTC | |
|
Re: variable reference to subroutine while "strict"
by kyle (Abbot) on Apr 13, 2008 at 19:00 UTC | |
|
Re: variable reference to subroutine while "strict"
by tinita (Parson) on Apr 13, 2008 at 19:59 UTC | |
|
Re: variable reference to subroutine while "strict"
by moritz (Cardinal) on Apr 13, 2008 at 18:05 UTC | |
|
Re: variable reference to subroutine while "strict"
by pc88mxer (Vicar) on Apr 13, 2008 at 18:02 UTC | |
|
Re: variable reference to subroutine while "strict"
by ysth (Canon) on Apr 14, 2008 at 04:45 UTC |