I'm trying to merge and edit two files with this program (short example files in %data ) #!/usr/bin/perl -s -- use strict; use warnings; use autodie; Main( @ARGV ); exit( 0 ); sub Main { if( $help ){ return print Usage(); } open my($in1) , '<', \$data{input1}; open my($in2) , '<', \$data{input1}; while( not( grep eof, $in1, $in2 ) ){ my $line1 = <$in1>; my $line2 = <$in1>; chomp $line1; print $line1, $line2; } close $in1; close $in2; } sub Usage { <<"__USAGE__"; $0 $0 -help $0 -foo $0 -oof=bar $0 -oof=bar baz __USAGE__ } ## end sub Usage BEGIN { our %data = ( input1 => \<<'__VROOM', __VROOM input2 => \<<'__VROOM', __VROOM expectedOutput => \<<'__VROOM', __VROOM ); } ## end BEGIN __END__

I want the get output $data{expectedOutput} but it gives me this error message / faulty output:

error message or faulty output here

I'm trying to ...

I also tried ...