in reply to Re4: Finding part of a file
in thread Finding part of a file
Interestingly enough, I can goto outside of an eval block without any complaints:
...re your update - that's a neat trick that I'll have to tuck away.#!/usr/bin/perl use strict; use warnings; my $begin='banana'; my $end='grape'; while(<DATA>) { /$begin/ ? eval { /$end/ ? goto END : print while (<DATA>) } : next } END: exit; __DATA__ apple banana pear peach grape orange
|
|---|