Oh. Ok, so your problem is in calling a method.
Then the solution is get the name of the method into a scalar variable before trying to call it.
#!/usr/bin/perl use strict; use warnings; package Foo; sub new { bless {}, shift; } sub test { print "pass\n"; } package main; my @subs = ('test'); my $foo = Foo->new; my $method = $subs[0]; $foo->$method;
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re^2: calling functions using array variables
by davorg
in thread calling methods using array variables
by rsennat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |