can you give us a snip of what's in 
@prv_lst
@txn_log

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 5:18 PM
To: [EMAIL PROTECTED]
Subject: Grep function inside a for loop does NOT grep the values.


Hi,

I am sorry, I meant to say grep does not work inside a for loop.

regards,
Satya
----- Forwarded by Satya Devarakonda/THP on 02/19/2002 05:18 PM -----
 

                    Satya_Devarakonda@tufts-

                    health.com                      To:
[EMAIL PROTECTED]                                                
                                                    cc:

                    02/19/2002 05:13 PM             Subject:     Grep
function inside a for loop does grep the values.        
 

 





Can somebody help me on what is wrong in the following piece of code?

foreach (@prv_lst)
{
        $item = $_;
        @list_prv = grep (/$item/, @txn_log);
        print "The foll. are the Txn details for Trading Partner $item \n";
        print @list_prv;
        for (@txn_lst)
        {
                $aprf = $_;
                $cnt = 0;
                @list_prv_txn = grep (/$aprf/, @list_prv);
                for (@list_prv_txn)
                {$cnt++};
                print "The number of ${aprf}'s are ${cnt} \n" ;
    }
}

I dont see any values in the @list_prv eventhough I get one assiging a
value to $item
like
$item = "abc";
--------------------
Thanks in advance,
Satya



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to