CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Printing Recod

 



stanley
Novice

Jan 15, 2001, 6:54 PM

Post #1 of 2 (267 views)
Printing Recod Can't Post

Hi everyone,

I have this records in my text file :

michael|mick@hotmail.com|20-November-2000
michael|mick@hotmail.com|03-November-2000
michael|mick@hotmail.com|23-November-2000
mick|burger@hotmail.com|23-November-2000
mick|burger@hotmail.com|03-November-2000
mic|mic@hotmail.com|23-November-2000
ham|ham@hotmail.com|23-November-2000



When I do a query/search "mic" in field #1, I want the result to be displayed like this:

Search Result
--------------------

<li> Michael
<li> Mick
<li> Mic

instead of displaying the results like this:

Search Result
--------------------

<li> Michael
<li> Michael
<li> Michael
<li>Mick
<li> Mick
<li> Mic

Hope you understand what I mean..sigh...
Thanks
Stan





sleuth
Enthusiast

Jan 16, 2001, 2:53 AM

Post #2 of 2 (262 views)
Re: Printing Recod [In reply to] Can't Post

 
Yea, I do.

I assume your using while.

while(<data>){
($name,$email,$date)=split(/\|/, $_);
if (exists($seen{$name})){
}else{
print "<li> $name";
$seen{$name}="toasted";
}
}

Hope I remembered that correctly,

Sleuth


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives