Clear questions and runnable code
get the best and fastest answer
Hi Perl Monks,
I am a beginner in perl programming. I have written a perl script which can read a small text file and gives correct results for inter-substring distance in cmd in Windows XP. But cmd shows the problem of “out of memory” when I try to analyze a large text file with 219475005 letters for finding the inter-substring distance although the program counts the number of each letter in the file correctly within 2 minutes but fails to find the inter-substring distance. I think this could due to incorrect reading of file.
So I have given the initial part of the script and the results of cmd screen below. I am seeking your suggestions to rectify the mistake in the script for analyzing a large file.
Furthermore, I need the syntax at the initial part to assign the input large file to an array variable like my @lines so that I can assign this array to a scalar variable like my $string ="@lines"; for use in later part of the script.
Command Prompt Results:
C:\Documents and Settings\user\Desktop>m3.pl
Please type the filename of the DNA sequence data: chr1.txt
Number of bases: 219475005.
A=63473407; T=63582431; G=45425056; C=45435903; Errors(N)=1558208.
Enter a motif to count nt between two such motifs: GAATTCCT
I found the motif!
Out of memory!
C:\Documents and Settings\user\Desktop>
Thanks to Perl Monks for their quick reply in solving perl problems.