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


in reply to Re: File Input and Output
in thread File Input and Output

I m having trouble using this in a script. I have a test file that looks like :

open(my $fh1, ">>", "outputcontrol.txt"); open(my $fh2, ">>", "outputoutput.txt"); while ( <> ) { my $count = ($_ =~ y/x//); print "$count \n"; # print $_; if ( $count != $delim_amnt_per_line ) { print fh1 $_; } my ($prefix) = substr $_, 0, 7; next if $seen{$prefix}++; print fh2 $_; }

Its supposed to do some checks on delimiter per line and remove duplicates based on a substring, my problem is that i have zero output on the filehandles. Whereas if i ran it with just print it would print normally, both expected outputs on STDOUT. Can someone help me?