while ( my @rids = $fac->each_rid ) {
die "No record found\n" unless @rids;
foreach my $rid ( @rids ) {
my $result = $fac->retrieve_blast( $rid );
if( ref( $result )) {
my $output = $result->next_result();
my $filename = $output->query_name().".out";
$filename...
What is the recommened/common pod format/template in practice? Of course, they will vary, but in general?
I have an example:
=pod
=head1 NAME
Debugging mod_perl Perl Internals
=head1 Description
This document explains how to debug Perl code under mod_perl.
=head1 Maintainers
Maintainer...
What is this error about and how to fix?
Can't modify constant item in scalar assignment at line 16, near "}"
#! /usr/bin/perl
use strict;
use warnings;
package Protein;
our %attrib;
sub new {
my( $class , %attribs ) = ( @_ );
my $obj = {
_name =...
How do you parse the data (Seq.txt) into a table in mysql?
The txt data look like:
>AREDD7|Mus musculus|brain|45545|411|741
aagcggccggtctgcagtcggagacttgcaggcagcaaacacggtgcgaacgaaccggag
gggggagagagaaatcaaacagctaagcgtggagcagacggcctgggacccagaagggga
tcgatgcgaggagcgcaataata...
I have a form:
#! /usr/bin/perl
use warnings;
use strict;
use CGI ( ':standard' );
my $title = 'Sequence Search';
my $seq = param( 'Seq' );
print header,
start_html( $title ),
h1( $title ),<<"PrintTag",end_html;
<form name="SearchSeq" method="post" action="SearchSeqResult.cgi">
<p>...
use Test::Simple tests
print "Enter sequences: ";
chomp(@CheckChar= <STDIN>);
// when ‘abd’ (please note ‘ ‘) is entered, it gives me.
ok( grep(/abd|ABD/i, @CheckChar), "A word, 'abd', checks" );
ok 1 - A word, 'abd', checks
// when abd (please note w/o ‘ ‘) is entered, it gives me ‘Failed...
How do you put die () in this case? if !CheckSeq (); then, sub 2nd and sub 3rd don’t need to be called and don’t need to print.
sub CheckSeq {
return scalar grep /[abceABDE]/, @SeqChar;
}
sub 2nd{
}
sub 3rd {
}
print "1. Your input contains valid sequence.\n"
if CheckSeq ()...
I put this in a modue.
sub trans {
my %translate = (
'uvx' => 'asn',
'uxx' => 'cya',
'yyu' => 'tis',
'xvu' => 'lis'
);
for( @SeqChar ){
tr/abce/uvxy/;
s/(...)/$translate{$1}/g;
print $_,"\n";
}
}
trans();
1;
How do you get the acutal...
chomp(@SeqChar = <STDIN>)
sub trans {
map {tr/abce/uvxy/, print "$_\n"} @SeqChar;
}
How do you get the strings translated from 'sub trans' and print the corresponding strings on the screen?
i.e.
if the strings translated are 'uvx' then print 'asn' on the screen
if the strings translated...
#! /usr/bin/perl
use strict;
use warnings;
my @SeqChar;
print "Enter sequences and 'enter' and then Ctrl + D: ";
chomp(@SeqChar = <STDIN>);
sub StartChar {
my $abc;
$abc+= /(abc|ABC)/g
for @SeqChar;
return $abc
}
print "\n";
print "Yes, your input contains a seq char (abc).\n"
if...
#! /usr/bin/perl
use strict;
use warnings;
my @SeqChar;
chomp(@SeqChar = <STDIN>);
sub is_invalid_list {
return scalar grep /[^a-dA-D]/, @SeqChar;
}
print "Yes\n" if is_invalid_list( qw/yes daad cab/ );
Why is it not returning anything?
jl
#! /usr/bin/perl
use strict;
use warnings;
my @ArrayNum = (1,2,3,4,5,6,7,8,9);
How do you display the numbers in matrix like below?
matrix 1)
1 2 3
4 5 6
7 8 9
matrix 2)
1 4 7
2 5 8
3 6 9
jl
I am seeing two issues:
1) the 1st entry doesn't get any regexp checked.
Enter Number: 100
2) regexps are not matching correctly.
Enter Number or 'exit' to exit: 100
100 is a whole number
100 is an integer
100 is a +/- integer
100 is a real number
100 is a decimal number
100 a C float
Enter...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.