in reply to Re: print data with matching id from two different files
in thread print data with matching id from two different files

#use strict;

Never do this. Never comment out strict. If your script only compiles without strict, put it back in and fix all the errors first before doing anything else. strict is there to stop you making mistakes.

Replies are listed 'Best First'.
Re^3: print data with matching id from two different files
by mao9856 (Sexton) on Nov 02, 2017 at 12:17 UTC
    #!usr/bin/env perl use strict; use warnings; open (FILE1,"< file1"); while (!eof(FILE1)) { chomp (my$element1 = (<FILE1>)); open (FILE3,"< file3"); while (!eof(FILE3)) { my$element2 = (<FILE3>); if ($element2 =~ /$element1/) {print $element2;} } }