Bioinf
view release on metacpan or search on metacpan
# Function :
# Example :
# Keywords :
# Options :
# Author : jong@salt2.med.harvard.edu,
# Category :
# Version : 1.0
#------------------------------------------------------------------------------
sub get_perl_keywords{
my(%perl_keywords);
my @keywords=qw( AUTOLOAD BEGIN CORE DESTROY END abs accept alarm and atan2 bind binmode bless caller chdir chmod chop chown chr chroot
close closedir cmp connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent
eof eq eval exec exit exp fcntl fileno flock for foreach fork format formline ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin
getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname
getservbyport getservent getsockname getsockopt glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst le length link listen local localtime log lstat
lt m mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord pack package pipe pop print printf push q qq quotemeta qw qx rand read readdir readline
readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir s scalar seek seekdir select
semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift
shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat
study sub substr symlink syscall sysread system syswrite tell telldir tie time times tr truncate uc ucfirst
umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray
$out_subs{"$each_sub"}.="$lib[$j]"; ## to fetch '}'
$j++;
WRITE:
open (EACH_FILE, ">$each_sub\.pl");
print EACH_FILE "#\!\/perl\n";
print EACH_FILE "# Made by $0 at: ", `date`, "\n";
print EACH_FILE $out_subs{$each_sub};
close EACH_FILE;
%out_subs=();
#chmod
}
}
}#""""""""""""" end of for (@file)
close LIB_FILE;
}
#___________________________________________________________
for (@lines){
if(/^(.*)($old)(.*)$/){
$temp="$1${new}$3\n";
print "\nmatched $_ in $file, becomes: $temp\n";
print OUT $temp;
}else{
print OUT $_;
}
}
close OUT;
if($file =~/\.pl$/){ chmod 0755, $file; } # this makes it execu..
}
return(\@input_files); # returning the changed files
}
#________________________________________________________________________
# Title : get_av_seq_length
# Usage : $std_devi_of_lengths = &get_av_seq_length(\%hash_ref);
for $file(@input_files){
open (IN, "$file");
my @lines=<IN>;
close(IN);
open (OUT, ">$file");
for $line(@lines){
$line=~s/$old//g;
print OUT $line;
}
close OUT;
if($file =~/\.pl$/){ chmod 0755, $file; } # this makes it execu..
}
}
#____________________________________________________________________
# Title : remove_elements_by_pattern
# Usage : @out2 = @{&remove_elements_by_pattern(\@input1, \@input2,,,,)};
# @out1 = @{&remove_elements_by_pattern(\@input1 )};
# Function :
# Example :
# Keywords :
# Options :
# Author : jong@salt2.med.harvard.edu,
# Category :
# Version : 1.0
#------------------------------------------------------------------------------
sub get_perl_keywords{
my(%perl_keywords);
my @keywords=qw( AUTOLOAD BEGIN CORE DESTROY END abs accept alarm and atan2 bind binmode bless caller chdir chmod chop chown chr chroot
close closedir cmp connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent
eof eq eval exec exit exp fcntl fileno flock for foreach fork format formline ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin
getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname
getservbyport getservent getsockname getsockopt glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst le length link listen local localtime log lstat
lt m mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord pack package pipe pop print printf push q qq quotemeta qw qx rand read readdir readline
readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir s scalar seek seekdir select
semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift
shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat
study sub substr symlink syscall sysread system syswrite tell telldir tie time times tr truncate uc ucfirst
umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray
$out_subs{"$each_sub"}.="$lib[$j]"; ## to fetch '}'
$j++;
WRITE:
open (EACH_FILE, ">$each_sub\.pl");
print EACH_FILE "#\!\/perl\n";
print EACH_FILE "# Made by $0 at: ", `date`, "\n";
print EACH_FILE $out_subs{$each_sub};
close EACH_FILE;
%out_subs=();
#chmod
}
}
}#""""""""""""" end of for (@file)
close LIB_FILE;
}
#___________________________________________________________
for (@lines){
if(/^(.*)($old)(.*)$/){
$temp="$1${new}$3\n";
print "\nmatched $_ in $file, becomes: $temp\n";
print OUT $temp;
}else{
print OUT $_;
}
}
close OUT;
if($file =~/\.pl$/){ chmod 0755, $file; } # this makes it execu..
}
return(\@input_files); # returning the changed files
}
#________________________________________________________________________
# Title : get_av_seq_length
# Usage : $std_devi_of_lengths = &get_av_seq_length(\%hash_ref);
for $file(@input_files){
open (IN, "$file");
my @lines=<IN>;
close(IN);
open (OUT, ">$file");
for $line(@lines){
$line=~s/$old//g;
print OUT $line;
}
close OUT;
if($file =~/\.pl$/){ chmod 0755, $file; } # this makes it execu..
}
}
#____________________________________________________________________
# Title : remove_elements_by_pattern
# Usage : @out2 = @{&remove_elements_by_pattern(\@input1, \@input2,,,,)};
# @out1 = @{&remove_elements_by_pattern(\@input1 )};
( run in 0.256 second using v1.01-cache-2.11-cpan-496ff517765 )