1.TITLE OF FIRST RECIPE
abstract
Ingredient 1.
Ingredient 2.
Ingredient n...
Procedure...
2.TITLE OF SECOND RECIPE
...
####
my @array=split (//,$linea);
####
#!/usr/bin/perl
use warnings;
use diagnostics;
use strict;
my $text_file="cookbook.txt";
my $output="output.txt";
open(my $INPUT,"<",$text_file ) || die "Error: $!\n";
open(my $OUT,">",$output) || die "Error: $!\n";
my $linea = do { local $/; <$INPUT> };
$linea=~ s/[\r\n]/\n/g;
$linea=~ s/\n\n/\n/g;
if ($linea=~ //) {
print $OUT $linea;
}
close $OUT;
close $INPUT;
exit;