in reply to Re^2: Selection of a part of a text
in thread Selection of a part of a text

You may find:

use strict; use warnings; 1 while defined ($_ = <DATA>) and ! m/^REGULATION SLOT/; while (<DATA>) { my @Elements = split ";"; my $element = $Elements[1]; my @Parts = split " ", $element; print join (';', @Parts), "\n"; } __DATA__ Header line to be skipped REGULATION SLOT LAYOUT + REGULATED FLIGHTS element 1; element 2

a somewhat cleaner technique. Note that the I/O using external files has been replaced by DATA and STDOUT for purposes of demonstration.


DWIM is Perl's answer to Gödel