you have a question on how to do something in Perl, or
you need a Perl solution to an actual real-life problem, or
you're unsure why something you've tried just isn't working...
then this section is the place to ask. Post a new question!
However, you might consider asking in the chatterbox first (if you're a
registered user). The response time tends to be quicker, and if it turns
out that the problem/solutions are too much for the cb to handle, the
kind monks will be sure to direct you here.
Dear Monks, Please may I kindly ask for some assistance please?
Please be gentle however.. I am not an expert coder and I am also incredible inefficient, but for now I have to code in a way that makes logical sense to me. I have tried my best for 5 days with this and now I'm at the point where I need some external help...
The input file is commented in the code since I can't upload it for you. Essentially what I am trying to do is change the last column of the input (a 9 letter sequence) by changing each letter to an alternative of 3 letters AGCT, then moving onto the next letter in the sequence.
I.e. for each character of the last column, if it matches A, then switch to G then print new line, switch to T then print new line, switch to C then print new line (whilst remaining sequence stays same).
Example 1: for >chr1 67093601 67093610 CTACAGGAA -> switch to GTACAGGAA, TTACAGGAA, ATACAGGAA.
Then: CTACAGGAA -> switch to CAACAGGAA, CGACAGGAA, CCACAGGAA etc.
Therefore, for each sequence there should be 27 new sequences.
From looking at the output, I think the issue lies in the "$sequence =~ s/$test/C/;" bit of code, but I don't know how to fix it... the $j seems to count along the string as I'd like it to, but sometimes the wrong letter in the sequence in changed, and sometimes it is not!
If anyone can help me, I will be very, very grateful.
In my script i give user a parameter where he mentions he wants to run this script for x number of hours, how should i implement this?
I read online , one way could be using SIGALRM and writing handler for this so that when this is achieved I stop the script,
please suggest other efficient ways if there exist, thanks
my $parser=new XML::DOM::Parser;
my $doc=$parser->parsefile('C:\perl\perl_tests\xmlin.xml') or die$!;
XML file :<config logdir="var/log/foo/" debugfile="tmp/foo.debug">
<server name ="sahara" osname ="solaris" osversion="2.6">
<server name="gobi" osname="irix" osversion="6.5">
<server name="kalahari" osname="linus" osversion="2.0.34">
when I try to run this script I get an error saying : can't locate object method "getAttribute" via package "XML::DOM::NodeList" at C:\perl\perl_tests\xmlin.pl line 10.
what is the problem with my script?
this is some part of my code. If the input number is 0 or less than 0 than it should jump to some other part say line number 32 of my code. how can I achieve that? any specific function which I can use?
Help! I've been running ActivePerl for years now & have scores of scripts running to manipulate data & update websites. Last night Windows 10 did a major update to Build 1607 (the 'Anniversary Edition'). Perl no longer works! The cmd window opens but nothing happens. When clicking on a .pl file, I get a UAC warning about 'no publisher' and then the same dead cmd window. I tried installing Strawberry. That eliminated the UAC warning, but still won't run. I've had to fire up my Win 7 machine as backup. Has this happened to anyone else?
I want to compare two files on the basis of two different Ids, and want to print something, if the Ids matched.
I opened the two files and used while loop (i.e. while within while). The if condition of this prog. is working good, but else condition will give lots of lines, because of while within while.. "last;" is also not working here..
As a followup to my previous thread(http://www.perlmonks.org/?node_id=1172488) I was wondering if someone could recommend a good on line tutorial to get started with Perl. I come from a background of Java/C# and I understand the concept of classes/polymorphism etc.. I know I said that I don't trust websites and prefer books, but, it's going to be some time before I get my hands on Learning Perl.