Welcome to the Monestary ploaiza.
Here's an approach to your problem, but since you haven't clearly stated what your problem was (with example code, for instance), it might be a complete miss). And moreover it is a quick and dirty hack
open (O, "rules.txt") or die "$!"; my ($wanted_lines); { local $/ = undef; # 'Slurp' mode on my $whole_file = <O>; close O; $whole_file =~ /FirstWord(.+?)LastWord/s; $wanted_lines = $1; } print $wanted_lines
Update
danger solution is really neat! forget mine!
Though, while looking at your code, one can see it is not really 'perlish'
Here are a few point that could improve your perl coding style.
($_ =~ /^Lot Code/)can be replaced by
(/^Lot Code/)as the match is against the $_ anyway.
for ($j=0; $j < $i; $j++)You can use the '..' operator to make things clea(n|r)er:
for (0 .. $i)
my %datas = (
1 => {subject => 'foo', failed => 'bar',},
2 => {subject => 'baz', failed => 'too',},
);
In reply to Re: Concatenating lines found between two words
by OeufMayo
in thread Concatenating lines found between two words
by ploaiza
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |