in reply to How to perform a subroutine run in cpan Tk::ExecuteCommand module
my $cmd = `&test($param1, $param2)` ;#Subroutine to be called by the T +k::ExecuteCommand button click
Backticks are not how you store a subroutine to be called later. See qx on what backticks actually do.
Did you try printing $cmd to find out what is actually contained in $cmd.
Most likely, you want to store a subroutine reference in $cmd:
my $cmd= sub { test($param1, $param2); };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to perform a subroutine run in cpan Tk::ExecuteCommand module
by Janish (Sexton) on Jun 25, 2014 at 07:44 UTC | |
by Corion (Patriarch) on Jun 25, 2014 at 07:50 UTC | |
by Janish (Sexton) on Jun 25, 2014 at 08:11 UTC | |
by Corion (Patriarch) on Jun 25, 2014 at 08:16 UTC | |
by Janish (Sexton) on Jun 25, 2014 at 08:25 UTC | |
| |
by Janish (Sexton) on Jun 25, 2014 at 08:14 UTC |