Another way...
#!/usr/bin/perl
use strict;
open( my $ls_output, '-|', 'ls' )
or die "Cannot execute ls - $!";
print "$_\n" while (<$ls_output>);
close( $ls_output );
I'm not sure why you do not want to use the diff function. Anyway, here's a crude way of doing what you want.
#!/usr/bin/perl
use strict;
my $file_1 =<<file_a;
apple|1
banana|1
kiwi|3
file_a
my $file_2 =<<file_b;
banana|2
kiwi|3
strawberry|1
file_b
my %record_1;
open( my $file, '<'...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.