On Tue, 19 Feb 2002 [EMAIL PROTECTED] wrote: > 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";
Possible $_ contains a trailing newline? See perldoc -f chomp. It's hard to say without knowing what the actual data is. -- Brett http://www.chapelperilous.net/ ------------------------------------------------------------------------ There are three rules for writing a novel. Unfortunately, no one knows what they are. -- Somerset Maugham -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]