Ah ok... by using ord() on a string, is the string converted to a scalar, resulting in only the first character of the string?. Ahwell, I could test it myself ofcourse :)
I will keep it's speedperformance in mind. Perhaps one day I want to search in the whole genome, and will build a hash using...
Thanks alot! that code seems to work, I realized while planning the code that I needed to make a construction like you made, get into a loop after finding a ">" filling the hash and breaking out of the loop when finding the next ">". However, I failed at that since I didnt realize I can nest a...
Hello guys,
On a bioinformatics related project I want to read in the contents of a file (fasta format) to a fastafile. The file looks for example as follows:
>1
sequence1
>2
sequence2
>3
sequence3
>1
sequence1
Now, I'm building a hash using the following code, works perfectly fine...
I'm using a Mac.
I know my file contains \r as newlines, the texteditor I use can replace it.. when I replace \r with \n, I can use the file without any problems with my PERL script. But I want my script to be more flexible and be able to handle textfiles from multiple sources without the need...
I was thinking that chomp only removes \n, anyway the following code is not working either to remove carriage returns.
the following code is not working either
while ($input = <LOOKUPFILE>)
{
chomp $input;
$input =~ s/\r//g;
push (@lookupgenes, $input);
}
............
while ($input =...
Hi, I'm a scientist using PERL to write some very handy scripts. I spent alot of hours writing my first script, and it works very well! however I'm running into some problems:
This is the type of info that I use as input, it's contained in a plain text file (txt):
An15g05370
An09g00720...
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.