Beefy Boxes and Bandwidth Generously Provided by pair Networks
Frank Syntactic Confectionery Delight  Is this code logical?  by
Win (Novice) on Feb 24, 2006 at 14:07 UTC
( #532543=perlquestion: print w/ replies, xml ) Need Help?? Win
has asked for the wisdom of the Perl Monks concerning the
following question:  Can someone please tell me whether there is
anything wrong with the logic of the following bit of code. my
$new_outputfile = $outputfile."_B"; open (RESULT_FILE,
"<$outputfile"); open (CLEANED_RESULT, "+>$new_outputfile"); our
@data = <RESULT_FILE>; chomp @data; my %seen; for ( @data) {
next if $seen{$_}++; print CLEANED_RESULT "$_\n"; } remove
$outputfile or warn $!; rename "$new_outputfile", "$outputfile"
or warn $!; It does not appear to be doing what I ask of it.
Update: The output file is present as a directory location and
file name like: C:/Perl_activate/filename.txt  Comment on Is
this code logical? Download Code Re: Is this code logical? by
CountOrlok (Friar) on Feb 24, 2006 at 14:16 UTC