#!perl -w use strict; use Shell qw(dir); my $command = "dir *.txt"; print "Executing a shell command, $command\n"; my $text = `$command`; print "DIR back tics:\n$text\n"; $text = qx/$command/; print "DIR qx command:\n$text\n"; print "DIR system output:\n"; system("$command"); $text = dir("*.txt"); print "DIR Shell library:\n$text\n"; my $poly_a_tail_search = qr/a{2,}ta{3,}/io; my $sequence = "GACTCATCATAATAAAAAAAAATAGCATCATCATAATAAAAA"; # process this set of genes @ARGV = ( "pccx1.dna" ) if scalar @ARGV < 0; while ( $sequence =~ /$poly_a_tail_search/ ) { my $count = 0; while ($sequence =~ /$poly_a_tail_search/g) { ++$count; } print "Number of poly a tails: ", $count, "\n"; $sequence = next_sequence(); } my @array = (); print 'Empty @array means $#array is: ', $#array, "\n"; print 'Empty @array means scalar @array is: ', scalar @array, "\n"; @array = ("one"); print 'One item in @array means $#array is: ', $#array, "\n"; print 'One item in @array means scalar @array is: ', scalar @array, "\n"; @ARGV = ( "pccx1.dna" ) if scalar @ARGV < 0; exit(1) unless scalar @ARGV > 0; my $count = 0; while ( <> ) { while ( /$poly_a_tail_search/g ) { ++$count; } if ( eof ) { print "File: ", $ARGV, "\tNumber of poly a tails: ", $count, "\n"; $count = 0; } } sub next_sequence { return ""; } exit(0);