Hi all, my first time here! Can someone assist me? i need to write a "simple" perl scripts to cancatenate two strings (preferably short DNA sequences) using the subroutine function? Mine doesnt print anything.Also need general hints on subroutines.I'm still new to perl (and programming in general!).
Here is the script I had writen:
Here is the script I had writen:
Code:
#!/usr/bin/perl; #subroutine to concatenate two strings of dna #practicesubroutines1.txt sub conc($); print "enter the dna sequence1>>"; $dna1=<>; print "enter dna sequence2>>"; $dna2=<>; $newdna=conc($dna); print "the new dna is $newdna\n"; sub conc($) { my $dna1=$_[0]; my $dna2=$_[0]; $dna="$dna1"."$dna2"; return $dna; }
Comment