Aren't you missing a chomp? Assuming so, sSomething like:
my $fh = open_file( 'filename' ); print read_first_line( $fh ); print read_two_lines( $fh ) until eof( $fh ); sub read_first_line { my $fh = shift; return scalar <$fh>; } sub read_two_lines { my $fh = shift; chomp(my $first = <$fh>); return $first . <$fh>; }
In reply to Re: When every 2 lines of a file (sans first) should be 1...
by chromatic
in thread When every 2 lines of a file (sans first) should be 1...
by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |