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
An04g05050
An16g03160
An08g11930
...
This is part of the program I use to populate an array line by line based on the above textfile:
print "\nPlease type the name of the file with geneIDs and press ENTER: ";
$lookupfile_name = <STDIN>;
chomp $lookupfile_name;
#Opening the lookupfile containing the GeneID's and
open (LOOKUPFILE, "$lookupfile_name") or (die "\n\nSomething terrible has gone wrong! The file you specified could not be opened\n\n");
while ($input = <LOOKUPFILE>)
{
$input =~ s/\r//g;
push (@lookupgenes, $input);
}
I tried a number of different substitutions to get rid of the \r (eg. s/\r/\n//g) but nothing seems to work.
For some reason PERL doesnt replace the \r in the input file. However, when I manually replace \r with \n using the advanced search and replace function in my text editor and use that modified file, my script works perfectly fine!
however, I'm unable to remove all \r using PERL.
This is the type of info that I use as input, it's contained in a plain text file (txt):
An15g05370
An09g00720
An04g05050
An16g03160
An08g11930
...
This is part of the program I use to populate an array line by line based on the above textfile:
print "\nPlease type the name of the file with geneIDs and press ENTER: ";
$lookupfile_name = <STDIN>;
chomp $lookupfile_name;
#Opening the lookupfile containing the GeneID's and
open (LOOKUPFILE, "$lookupfile_name") or (die "\n\nSomething terrible has gone wrong! The file you specified could not be opened\n\n");
while ($input = <LOOKUPFILE>)
{
$input =~ s/\r//g;
push (@lookupgenes, $input);
}
I tried a number of different substitutions to get rid of the \r (eg. s/\r/\n//g) but nothing seems to work.
For some reason PERL doesnt replace the \r in the input file. However, when I manually replace \r with \n using the advanced search and replace function in my text editor and use that modified file, my script works perfectly fine!
however, I'm unable to remove all \r using PERL.