12-01-2008
yeah actually but I need it to be taken from the treshold file and not hardcoded as a text in the script you wrote...
thanks radoulov you are simply a saver...!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I'd like to create perl functions in separate file from my scripts.
Does somebody know if it's possible to create and use a perl module without compiling it ?
Thanks. (4 Replies)
Discussion started by: jo_aze
4 Replies
2. UNIX for Dummies Questions & Answers
Hi Folks,
I posted a few days ago, thanks for the responses. My original question was for renaming files of sort 3p2325294.dgn in a directory containing multiple files. I need to drop the first 2 characters and the last in a unix script using Perl. How does it differ from using the Unix... (1 Reply)
Discussion started by: Dinkster
1 Replies
3. Shell Programming and Scripting
Hi,
Here is my problem.. i have 2 files (file1, file2).. i have wrote the last two lines and first 4 lines of "file2" into two different variables .. say..
my $firstrec = `head -4 $file2`;
my $lastrec = `tail -2 $file2`;
and i write the rest of the file2 to a tmpfile and cat it with head... (2 Replies)
Discussion started by: meghana
2 Replies
4. UNIX for Dummies Questions & Answers
Hi
i have written a perl script which was then converted to perl module by me. it works as expected. but i have to put it on many servers so i want to build a package for it. i dont know how to do that. just to check i copied perl module in "lib" directory which is working. ( directly copied... (1 Reply)
Discussion started by: zedex
1 Replies
5. Shell Programming and Scripting
I want to write a Perl script that manipulates multiple files. In the directory, I have files 250.*chr$.ped where * is from 1 to 1000 and $ is from 1-22 for a total of 22 x 10,000 = 22,000 files.
I want to write a script that only manipulates files 250.1chr*.ped where * is from 1 to 22.... (10 Replies)
Discussion started by: evelibertine
10 Replies
6. Programming
Hi everyone
I am a beginner in perl and I am trying to write a perl script. Basically I want to separate gene entries from phenotype entries in a text file which contains huge number of records and copy them in a separate file. The gene entries will have * symbol after the line FIELD TI. A... (7 Replies)
Discussion started by: kaav06
7 Replies
7. Shell Programming and Scripting
I have a function which does awk proceessing
sub mergeDescription {
system (q@awk -F'~' '
NR == FNR {
A = $1
B = $2
C = $0
next
}
{
n = split ( C, V, "~" )
if... (3 Replies)
Discussion started by: crypto87
3 Replies
8. UNIX for Dummies Questions & Answers
I'm writing a perl script that writes an html file.
use Tie::File;
my ($dir) = @ARGV;
open (HTML,">","$dir/file.html") || die $!;
#-----Building HTML file---------------------------
print HTML "<!DOCTYPE html>
<html>
<head>
<title>Output</title>
<link... (3 Replies)
Discussion started by: jrymer
3 Replies
9. Shell Programming and Scripting
Hi,
I am new to perl.
I am trying to write a small perl script for search and replace in a file :
========================================================
#!/usr/bin/perl
my $searchStr = "register_inst\.write_t\(";
my $replaceStr = "model\.fc_block\.";
open(FILE,"temp.sv") ||... (2 Replies)
Discussion started by: chettyravi
2 Replies
10. Shell Programming and Scripting
Hi all.
I am working on the below requirement of generating .xml file from .xls file which i have , can someone please help me or in writing the perl script for the same:
The xls file format is as below which has two columns and number of rows are not fixed:
Fixlet Name ... (12 Replies)
Discussion started by: omkar.jadhav
12 Replies
LEARN ABOUT DEBIAN
plack::app::cgibin
Plack::App::CGIBin(3pm) User Contributed Perl Documentation Plack::App::CGIBin(3pm)
NAME
Plack::App::CGIBin - cgi-bin replacement for Plack servers
SYNOPSIS
use Plack::App::CGIBin;
use Plack::Builder;
my $app = Plack::App::CGIBin->new(root => "/path/to/cgi-bin")->to_app;
builder {
mount "/cgi-bin" => $app;
};
# Or from the command line
plackup -MPlack::App::CGIBin -e 'Plack::App::CGIBin->new(root => "/path/to/cgi-bin")->to_app'
DESCRIPTION
Plack::App::CGIBin allows you to load CGI scripts from a directory and convert them into a PSGI application.
This would give you the extreme easiness when you have bunch of old CGI scripts that is loaded using cgi-bin of Apache web server.
HOW IT WORKS
This application checks if a given file path is a perl script and if so, uses CGI::Compile to compile a CGI script into a sub (like
ModPerl::Registry) and then run it as a persistent application using CGI::Emulate::PSGI.
If the given file is not a perl script, it executes the script just like a normal CGI script with fork & exec. This is like a normal web
server mode and no performance benefit is achieved.
The default mechanism to determine if a given file is a Perl script is as follows:
o Check if the filename ends with ".pl". If yes, it is a Perl script.
o Open the file and see if the shebang (first line of the file) contains the word "perl" (like "#!/usr/bin/perl"). If yes, it is a Perl
script.
You can customize this behavior by passing "exec_cb" callback, which takes a file path to its first argument.
For example, if your perl-based CGI script uses lots of global variables and such and are not ready to run on a persistent environment, you
can do:
my $app = Plack::App::CGIBin->new(
root => "/path/to/cgi-bin",
exec_cb => sub { 1 },
)->to_app;
to always force the execute option for any files.
AUTHOR
Tatsuhiko Miyagawa
SEE ALSO
Plack::App::File CGI::Emulate::PSGI CGI::Compile Plack::App::WrapCGI
See also Plack::App::WrapCGI if you compile one CGI script into a PSGI application without serving CGI scripts from a directory, to remove
overhead of filesystem lookups, etc.
perl v5.14.2 2011-11-02 Plack::App::CGIBin(3pm)