in reply to Between-text range operator problem
Now you can get the stuff out of the %data hash, or deal with it some other way. YMMV.my %pair = ( 'foo' => 'bar', 'jack' => 'daniels', 'Tom' => 'Jerry', 'BEGIN' => 'END', ); my %data; my $tail; my $type; while (<FILE>) { chomp; s/\s+$//; # Clean up invisible stuff if ($pair{$_}) { $type = $_; $tail = $pair{$_}; } elsif ($_ eq $tail) { undef $type; } push (@{$data{$type}}, "$_\n"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Between-text range operator problem
by jlongino (Parson) on May 17, 2002 at 02:19 UTC |