
regex2012
User
Apr 19, 2016, 9:23 AM
Post #1 of 3
(1678 views)
|
print if defined statement to file
|
Can't Post
|
|
I am trying to print this to a file:
open my $FH2, '<', '/tmp/testq.txt' or die "unable to open file 'file' for reading : $!"; open my $FH6, '>', '/tmp/tst.txt' or die "unable to open file 'file' for reading : $!"; my %duplicates; while (<$FH2>) { print if defined "$duplicates{$_},"; $duplicates{$_}++; } but I haven't been able to . I am not sure where to indicate the file handle in this statement to get it to print the duplicate line to /tmp/tst.txt. Can anyone help?
(This post was edited by regex2012 on Apr 19, 2016, 9:24 AM)
|