On 11/08/2014 11:38 AM, Shawn H Corey wrote:
On Sat, 8 Nov 2014 17:48:31 +0200
Shlomi Fish <shlo...@shlomifish.org> wrote:

The correct syntax is simply (untested):

        my $foo = "MyFoo::${pgm}Bar"->new;
FYI: That is called a symbolic reference. For more information, see
`perldoc perlref` and search for /Symbolic references/

BTW, symbolic references are not considered good practice. But if you
need them, you need them.


actually that is not a symref. it is just a class method call with a string. strings are allowed as class names and this works under strict. it is not generating a variable name there, just a class name which is just a string.

uri

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to