in reply to Between START .. END

Hie friends,
Now i can get the data in between <START> and <END>
How do i abort the script if there is no <END>?

Cheers,
Darren

Replies are listed 'Best First'.
Re^2: Between START .. END
by blazar (Canon) on Oct 06, 2005 at 08:47 UTC
    Now i can get the data in between <START> and <END>
    What do you mean with "get"? (Taking into account merlyn's answer) would something like
    push @lines, $_ unless $where == 1 or $where =~ /E0/;
    do?
    How do i abort the script if there is no <END>?
    IIUC you can realize that there's no end "tag" only when you terminate processing your input file. You may just maintain a flag:
    my $foundend; while (<file>) { next unless my $where = /START/ .. ($foundend=/END/); # ... } print "found\n" if $foundend.