View Single Post
Old 09-08-2011, 07:21 AM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
If you just want unique names ...

Here is a Perlish way to do it ...

Code:
#!/usr/bin/perl

use CGI::Carp qw/fatalsToBrowser/;
use CGI qw/:standard/;
use strict;
use warnings;

print "Content-type: text/html\n\n";



my $raw="file1";
#my $sorted="file2";#open and print file
open RAW,"<", $raw or die "<raw";
my @array=(<RAW>);


               my %seen = ();
               my @unique = grep { ! $seen{ $_ }++ } @array;

foreach my  $unique( @unique ){
chomp;
print "$unique<BR>\n";

}
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote