jet speed wrote:
> 
> Great, Thanks it works. Perfect.
> 
> I Will explore your recommendation for using seek File option. I will read
> some doc.
> 
> In your code, Pls explain what this piece of code does.
> 
> $sl{$1}++ if /\bID=(CK\w+)/i;

jet speed wrote:
> 
> I think it finds the bit starting with CK, if matches it stores in $sl($1)
> and finally prints  the key value as.
> 
> keys %sl,
> 
> bec's all matches are same it strores only once. am i correct ? Pls correct
> me if am wrong.

(Please bottom-post your replies to this group (add them after the previous
posts that you quote) so that long threads can remain comprehensible. Thank 
you.)

Yes that's pretty much it. It checks the current line in the file to see if
there's a part that matches /ID=CK\w+/, and if so it uses the CK\w+ part to
increment the value of the hash element with that key. If there is no such
element already then one will be created. After the loop, the value of each hash
element is the total number of times that key was seen: it's not used at all but
could be useful for debugging.

HTH,

Rob

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


Reply via email to