Ok, well I think I can see the forest but I have little idea as to what is actually going on here. I spent a few hours looking things up and I have a general sense of what is actually occurring but I am getting lost in the details that were posted in the last digest. See below:


On Sep 19, 2004, at 10:08, [EMAIL PROTECTED] wrote:

I see that you also made use of arrays. It struck me that, since the starting point is strings and not lists, using substr() would be more straight-forward:

  my %hash3;
  for ( keys %hash1 ) {
    while ( my $aa = substr $hash1{$_},0,1,'' ) {

I have never seen anything like this nor can I find anything in any of my Perl books to help me explain what the 0,1 and the " are doing to the substr of $hash1. I assume it is position information of some kind? If so, what is going on?


$hash3{$_} .= $aa eq '-' ? '---' : substr $hash2{$_},0,3,'';

This is something new to me. I think I follow your use of the ?: pattern feature. However, none of the perl books I have discuss it's use in this fashion. So, I am unsure of how you know to do that, or rather... how would I have known that I can do that? But basically I see that you are looking for '-' and equating it with what is matching between the ? and : (i.e. '---').


So, as far as I can tell, you are saying: "hey, if you find '-' in $aa then append a '---' in $hash3, otherwise append the next three DNA letters". However, I do not understand the syntax of how perl is actually doing this.

Help with explanation would be greatly appreciated. As you can see I can see what the big picture is, it's just that I am unable to determine mechanistically how perl is actually going about doing it. Also, any online references to the techniques used above would be great. I'd look for them myself but I do not know what some of these are actually called?

-Thanks so much, I have learned a little just from this much so far.
-mike


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to