Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^12: string value assignment

by marinersk (Priest)
on May 16, 2011 at 12:39 UTC ( #905061=note: print w/replies, xml ) Need Help??


in reply to Re^11: string value assignment
in thread string value assignment

abidq,

Stop for a moment. If you never answer any of my questions, precisely how much help do you think I can provide?

after that you can take my wife as well

I knew you had a sense of humor.

Ironically, this one line is the only reason I am going to continue trying to help you. The rest of your message basically says I'm too stupid to help you, so I am prepared to simply shut up and go away if that's the only useful thing I can do.

dn tell u didn understand my ques

The only alternative is to either lie to you, or to admit that I'm too stupid to help you. I do not understand the entirety of your question. Pieces of it seem to make sense, but your Perl script doesn't conform to what you seem to be saying -- which is almost certainly the problem here.

So if we can just get past these questions, we might be able to solve the problem. But this requires cooperation, and I don't understand why you won't just answer my questions.

I continue to live in fervent hope that we are merely having a communication problem, and that once past that, we can make progress.

please read my orig ques carefully

I have done so. Many times. I have even made reference to it when asking my questions. If you ask me to read your original message again, I will understand that I am too stupid to help you, and I will quietly surrender into the night. THE ORIGINAL MESSAGE IS NOT ENOUGH TO TRANSFER UNDERSTANDING. If you cannot accept this, then clearly you are so much smarter than me that I simply cannot comprehend your situation sufficiently to help you, and I will leave.

Or, alternatively, perhaps you could consider the faint possibility that maybe -- just maybe -- some clarification of your requirements is needed, and stoop to my level for a moment and answer my questions.

there are two input files

As I have repeatedly pointed out, your Perl script DOES NOT READ TWO FILES. It does read one, but it does not read two.

I suspect this is the crux of your problem. There are two input files, and you are not reading them.

Therefore, until you tell me where it is you think you're reading in the first file, I cannot help you.

So, apparently, in order to communicate, we have to overcome some hurdles:

  • Asking you questions doesn't work because you won't answer them;
  • Asking you to show what you're doing doesn't work because apparently you have no way to test your code without plugging it directly into a behemoth of a system and wait for it to be triggered;
  • Asking you to clarify your original message doesn't work because you seem supremely confident that anyone should be able to read it, comprehend it, and fully understand the problem with no further assistance from you.

So let's try yet another approach. (And I warn you, I'm running out of time, patience, and ideas on how to get you to provide useful information).

Here's a modified copy of your latest version of the script. Please use it for the next computational event and then ship me the resultant  asdebug.log  file.

That should answer the most fundamental of my questions and then maybe I'll get that flash of insight needed to solve this problem.

#!/usr/bin/perl $line=$ARGV[0]; #input file1 containing string list $name=$ARGV[1]; #output file, given at linux command chomp($line); chomp($name); &logit(2, "\$line = '$line'\n"); &logit(3,"\$name = '$name'\n"); $amino="ABC"; &logit(10, "\$amino = '$amino'\n"); @cc=split(//,$amino); $line=~ s/[\s]//g; &logit(14, "\$line = '$line'\n"); @prot=split(//,$line); $len=@prot; &logit(17, "\$len = '$len'\n"); open(NAS,">>$name"); print NAS"0"; close NAS; open(MAJ,"valfile"); #input file 2 containing values while($li=<MAJ>){ chomp($li); &logit(25, "\$li = '$li'\n"); $val=""; @value=split(/ +/,$li); for($p=0;$p<@prot;$p++){ &logit(30, "\$p = '$p'\n"); for($a=0;$a<@cc;$a++){ &logit(33, "\$a = '$a'\n"); if($prot[$p] eq "$cc[$a]"){ $val +=$value[$a]; &logit(39, "\$val = '$val'\n"); } } $val1=$val/$len; &logit(45, "\$val1 = '$val1'\n"); $val1=sprintf "%5.3f",$val1; } $number++; &logit(49, "\$number = '$number'\n"); open(MAL,">>$name"); print MAL" $number:$val1"; close MAL; } close MAJ; open(MAL1,">>$name"); print MAL1"\n"; close MAL1; exit; sub logit { my $logstr = join ' ', @_; if (open LOGFIL, ">>asdebug.log") { print LOGFIL "$logstr\n"; close LOGFIL; } }

Please send back the  asdebug.log  file and we'll see if we can't sort out what is going on.

Replies are listed 'Best First'.
Re^13: string value assignment
by Anonymous Monk on May 18, 2011 at 10:48 UTC
    Lost in admiration for this reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://905061]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2021-04-22 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?