Login

Join for Free!
118874 members
table of contents table of contents

Biology Articles » Bioinformatics » Introductory Workbook on Perl for Biology Students » 3. Perl program for concatenating two sequences

3. Perl program for concatenating two sequences
- Introductory Workbook on Perl for Biology Students

The Perl program is to perform concatenation of two sequences or strings. The concatenation as shown in the line 4 is just done by placing a dot. Here, the value of $DNA1 is being concatenated with the value of $DNA2. Hence, we write it as “$DNA1.$DNA2” and store the result as one complete string in $DNA3.

 

1.    #concatenate DNA sequence

2.    $DNA1="AGCTGCTTGGTTGCA";

3.    $DNA2="GCTGCCGTTGCAAA";

4.    $DNA3=$DNA1.$DNA2;

5.    print"concatenated seq:$DNA3\n";

 

RESULTS:

 

concatenated seq:AGCTGCTTGGTTGCAGCTGCCGTTGCAAA

rating: 3.70 from 114 votes | updated on: 30 Jan 2009 | views: 95096 |

Rate article:







excellent!bad…