1Padre::Task::Eval(3) User Contributed Perl Documentation Padre::Task::Eval(3)
2
3
4
6 Padre::Task::Eval - Task for executing arbitrary code via a string eval
7
9 my $task = Padre::Task::Eval->new(
10 prepare => '1 + 1',
11 run => 'my $foo = sub { 2 + 3 }; $foo->();',
12 finish => '$_[0]->{prepare}',
13 );
14
15 $task->prepare;
16 $task->run;
17 $task->finish;
18
20 Padre::Task::Eval is a stub class used to implement testing and other
21 miscellaneous functionality.
22
23 It takes three named string parameters matching each of the three
24 execution phases. When each phase of the task is run, the string will
25 be eval'ed and the result will be stored in the same has key as the
26 source string.
27
28 If the key does not exist at all, nothing will be executed for that
29 phase.
30
31 Regardless of the execution result (or the non-execution of the phase)
32 each phase will always return true. However, if the string eval throws
33 an exception it will escape the task object (although when run properly
34 inside of a task handle it should be caught by the handle).
35
37 This class contains now additional methods beyond the defaults provided
38 by the Padre::Task API.
39
41 Copyright 2008-2011 The Padre development team as listed in Padre.pm.
42
43 This program is free software; you can redistribute it and/or modify it
44 under the same terms as Perl itself.
45
46 The full text of the license can be found in the LICENSE file included
47 with this module.
48
49
50
51perl v5.32.1 2021-01-27 Padre::Task::Eval(3)