http://qs1969.pair.com?node_id=164907

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, I am trying to read a file and if it has the word unclassfied in it , to send to the good file and if not send to the bad file. any suggestions.
#!/usr/bin/perl use warnings; use strict; #open 3 filehandles open Classified, "c:/begperl/classified1_sports.dat" or die "Error mes +sage here: $!\n"; open Good, ">c:/begperl/good.dat" or die "Error message here: $!\n"; open Bad, ">c:/begperl/bad.dat" or die "Error message here: $!\n"; while (<Classified>){ if (Classified == unclassified) print FH Good\n; else { print "bad\n"; }