Perhaps something like this, if you have bash or ksh:
And you'd use it like
may be i could not get it completely: what are those function for in each script? please elaborate bit more.
problem here is:
each subprojects belogs to different group they dont wana write script/methods, instead they simple wana tell me files and cmmands and let me do how/what i do.
I have a shell script that runs all the time looking for a certain type of file and then it processes the file through a series of other scripts. The script is watching a directory that has files uploaded to it via SFTP. It already checks the size of the file to make sure that it is not still... (3 Replies)
Hi All,
I am very new to Shell scripting...
I got a requirement.
I will have few text files(data files) in a particular directory. they will be with .txt extension. With same name, but with a different extension control files also will be there. For example, Sample_20081001.txt is the data... (4 Replies)
Hello,
say suppose i am processing an file emp.dat the field of which are
deptno empno empname etc
now say suppose i want to change the file to emp.lst then how can i do it? Here i what i attempted but in vain
BEGIN{
system("sort emp.dat > emp.lst")
FILENAME="emp.lst"
}
{
print... (2 Replies)
Hi,
I am a beginner in shell scripting. I have written the following script, which is supposed to process the while loop for each line in the sid_home.txt file. But I'm getting the 'end of file' unexpected for the last line. The file sid_home.txt gets generated as expected, but the script... (6 Replies)
Hi Sorry to multipost. I am opening the new thread because the earlier threads head was misleading to my current doubt.
and i am stuck.
list=`cat /u/Test/programs`;
psg "ServTest" | awk -v listawk=$list '{
cmd_name=($5 ~ /^/)? $9:$8
for(pgmname in listawk)
... (6 Replies)
Hello everybody,
I have a little problem with one of my program. I made a plugin for collectd (a stats collector for my servers) but I have a problem to make it run in parallel.
My program gathers stats from logs, so it needs to run in background waiting for any new lines added in the log... (0 Replies)
Hi All,
The script below read the path and searches for the directories/subdirectories and for the files. If files are found in the sub directories then read the content of the all files and put the content in csv(comma delimted) format and the call the write to xml function to write the
std... (1 Reply)
Hello,
I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this :
This is the output of ls command : I stored the output in a file filelist
1.1M... (5 Replies)
I have one input file ABC.txt and one output DEF.txt. After the ABC is processed and created output, I want to rename ABC.txt to ABC.orig and DEF to ABC.txt. Currently when I am doing this, it does not process the input file as it cannot read and write to the same file. How can I achieve this?
... (12 Replies)
Discussion started by: High-T
12 Replies
LEARN ABOUT DEBIAN
moosex::role::timer
MooseX::Role::Timer(3pm) User Contributed Perl Documentation MooseX::Role::Timer(3pm)NAME
MooseX::Role::Timer - Measure times with your object.
SYNOPSIS
package Demo;
use Moose; # or Any::Moose
with 'MooseX::Role::Timer';
sub BUILD {
shift->start_timer("build");
}
sub do_something {
my $self = shift;
$self->start_timer("something");
# do something...
$self->stop_timer("something");
}
package main;
my $demo = Demo->new;
$demo->do_something;
$demo->do_something;
printf "%3.6fs
", $demo->elapsed_timer("build"); # time spent since BUILD
printf "%3.6fs
", $demo->elapsed_timer("something"); # time spent in sub do_something
This Role provides your object with timers, making it easier to keep track of how long whatever actions take.
start_timer($name)
Start timer $name.
stop_timer($name)
Stop timer $name. Could be started again to cumulatively measure time.
reset_timer($name)
Stops timer $name and clears cumulated times for $name.
elapsed_timer('name')
Return the elapsed time in seconds (cumulated) for timer $name.
timer_names
Return all timer names.
AUTHOR
Michael Langner, "<mila at cpan.org>"
BUGS
Please report any bugs or feature requests to "bug-moosex-role-timer at rt.cpan.org", or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Role-Timer <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Role-Timer>. I
will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
COPYRIGHT & LICENSE
Copyright 2010 Michael Langner, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-05-02 MooseX::Role::Timer(3pm)