Hi Jenda :-) Jenda Krynicky wrote: > > Is it safe to assume that all duplicates are together like this? If > so all you have to do is to > 1) read the file line by line > 2) only print the line you just read if it's different from the last > one > 3) remember the line > > or if I word it differently. > 1) read the file > 2) skip the line if it's the same as the last one > 3) print it and remember it > > my $last = ''; > while (<>) { > next if $_ eq $last; > print $_; > $last = $; ^^ Assigning the value of $; to $last will not do what you want. Note that it is not a syntax error as $; is a valid variable name and the semicolon is not required at the end of the block.
$last = $_ > } John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]