Assuming constant delimiters, a simpler solution:
#!/usr/bin/perl -w use strict; sub process { my ($data) = @_; print($data); # Or whatever } my $start = '*start*of*junk*data*'; my $end = '*end*of*junk*data*'; my $qfn = "file"; open( my $fh, '<:raw:perlio', $qfn ) or die("open $qfn: $!\n"); for (;;) { $/ = $start; my $good = <$fh>; last if !defined($good); chomp($good); process($good); $/ = $end; my $junk = <$fh>; last if !defined($junk); }
In reply to Re^2: Range question
by ikegami
in thread Range question
by magawake
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |