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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Post deleted by Jeff29


First page Previous page 1 2 Next page Last page  View All


Oct 27, 2010, 3:45 PM

Post #26 of 26 (2161 views)
Re: [Jeff29] Parsing a text file and outputting to an excel sheet [In reply to] Can't Post

The syntax for uniq is: uniq LIST

It returns a list with duplicates removed from the argument list.

There is a clever idiom that allows you to keep track of items you have already seen (or printed).

my %seen;  

print $cr_line, $match, $resolution_link, "\n" if ! $seen{$cr_line}++ ;

The hash declaration must be before any loops which include the print. When the loop completes, the hash contains the number to times each line was seen (only the first of each was printed). It is fun to try and figure out how this works.
Good Luck,

First page Previous page 1 2 Next page Last page  View All

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

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