Padre::Task::Eval(3pm) User Contributed Perl Documentation Padre::Task::Eval(3pm)NAME
Padre::Task::Eval - Task for executing arbitrary code via a string eval
SYNOPSIS
my $task = Padre::Task::Eval->new(
prepare => '1 + 1',
run => 'my $foo = sub { 2 + 3 }; $foo->();',
finish => '$_[0]->{prepare}',
);
$task->prepare;
$task->run;
$task->finish;
DESCRIPTION
Padre::Task::Eval is a stub class used to implement testing and other miscellaneous functionality.
It takes three named string parameters matching each of the three execution phases. When each phase of the task is run, the string will be
eval'ed and the result will be stored in the same has key as the source string.
If the key does not exist at all, nothing will be executed for that phase.
Regardless of the execution result (or the non-execution of the phase) each phase will always return true. However, if the string eval
throws an exception it will escape the task object (although when run properly inside of a task handle it should be caught by the handle).
METHODS
This class contains now additional methods beyond the defaults provided by the Padre::Task API.
COPYRIGHT & LICENSE
Copyright 2008-2012 The Padre development team as listed in Padre.pm.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.14.2 2012-06-27 Padre::Task::Eval(3pm)
Check Out this Related Man Page
Padre::Task::PPI(3pm) User Contributed Perl Documentation Padre::Task::PPI(3pm)NAME
Padre::Task::PPI - Generic PPI background processing task
SYNOPSIS
package Padre::Task::MyFancyTest;
use strict;
use base 'Padre::Task::PPI';
# Will be called after ppi-parsing:
sub process {
my $self = shift;
my $ppi = shift or return;
my $result = ...expensive_calculation_using_ppi...
$self->{result} = $result;
return;
}
1;
# elsewhere:
Padre::Task::MyFancyTest->new(
text => 'parse-this!',
)->schedule;
DESCRIPTION
This is a base class for all tasks that need to do expensive calculations using PPI. The class will setup a PPI::Document object from a
given piece of code and then call the "process_ppi" method on the task object and pass the PPI::Document as first argument.
You can either let "Padre::Task::PPI" fetch the Perl code for parsing from the current document or specify it as the ""text"" parameter to
the constructor.
Note: If you don't supply the document text and there is no currently open document to fetch it from, "new()" will simply return the empty
list instead of a "Padre::Task::PPI" object.
SEE ALSO
This class inherits from "Padre::Task" and its instances can be scheduled using "Padre::TaskManager".
The transfer of the objects to and from the worker threads is implemented with Storable.
AUTHOR
Steffen Mueller "smueller@cpan.org"
COPYRIGHT AND LICENSE
Copyright 2008-2012 The Padre development team as listed in Padre.pm.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
perl v5.14.2 2012-06-27 Padre::Task::PPI(3pm)
hello all,
as we know that the kernal Schedules tasks with some time slice given to each.
how does the Kernal know that the time of a Task has been elapsed?
does it follow the syatem Clock?or how?
thanks for your time (4 Replies)
Hi
I need some help with a task, i am an absolute newbie to any form of shell scripting and request guidance.
Task:
1. Read a config file in form of name value pair
ex
host=www.test.com
port=8080
binding="dynamic" or "other" or "something else"
key1=value1
key2=value2
key3=value4... (4 Replies)
I have file called myfile which has the text "myserver" in it. I need to have a command to ping "myserver". How would I do that?
I tried
when I type at the terminal I get the output as . How do I do something like a ?
thanks,
Nick (5 Replies)
Hi All,
I have too many .gz files (test.gz).
Task is to remove first line of each file.
Can I do it without unzipping the files?
Your help is appreciated. (4 Replies)
I have a number of strings that I want to remove:
<b>Task: 100</b>
<b>Task: 1100 </b>
<b>Task: 2200 </b>
But the numbers in them can vary from 4, 5 8, digits in length. But, no alpha chars.
I tried this:
sed '/Task:/,//d' $file > tmpfile ; mv tmpfile $file
But it removed additional text on... (5 Replies)
Hi experts,
I have a problem with the below shell task:
I need to modify the file creatin a paired row , per each row
which matches filter (e.g. number of nonempty columns = 5)
Output should look like this:
second row is original one from the input,
first row(red) is pairing row, it's... (29 Replies)
I have a file seperated by pipe(|) operator
I want to fetch lines from the file having the word "Task started" in 7th column
awk -F"" '{if($7 == "Task started") print $0}' file.txt
But this code is not giving any output.
Please kindly point out where I went wrong (43 Replies)
Dear all,
My work is completely stuck cos of the following issue. Please find it here and kindly help me.
Task is following:
I have set of files with such pattern
1t-rw-rw-r-- 1 emily emily 119 Jun 11 10:45 vgtree_5_1_pfs.root
3t-rw-rw-r-- 1 emily emily 145 Jun 11 10:46 vgtree_5_3_pfs.root... (4 Replies)
Hi
I am trying to run a script in a sub-directory, that has one space on it: such as:
/internaldisk1/Task Logs1, but my entry in cron is not working:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /internaldisk1/Task\ logs1/./remov_reject.sh > /var/tmp/interd_`date '+%Y%M%d'`.log 2>&1 Please can... (4 Replies)
Hi Gurus,
I have requirement to run different task based on input value. the sample file as below:
file1 (contains code need to be run)
code
aaa1
aaa2
bbb
ccc
ddd
file2 (contains all codes and job name)
code job1 job2
aaa1, job_aa1, job_a2
aaa2, job_aa2, job_a2
aaa3,... (5 Replies)
Hello
I have a problem with use bash script in windows task.
If I use script by cygwin it's working well.
If I use it by Windows task I'm get error
Error :
ERROR 2 (HY000) at line 2: File '.\xxx.csv' not found (Errcode: 2)
Code Line :
load data local infile './xxx.csv' REPLACE into... (16 Replies)
Hello everyone,
I am taking a course on Lynda and they show this code below. I didn't fully understand some parts. Please see the questions within the code.
Thank you for your input and time.
Regards,
function usage {
echo Options are -r -h -b -x --branch --version --help --exclude... (9 Replies)
Hi,
I am newbie tothis forum and also to unix.
i wa shownt help in giving me a acceptable code so that i could add it as batch to be included in the task scheduler.
i use plink and putty to login to my router.
With this i get to the $, linux prompt
there i have to issue a command show... (5 Replies)