in reply to printing up until a certain line within a file
Update: Oops, forgot to mention, the .. operator is documented in perlop. Thanks c.#!/usr/bin/perl -w use strict ; if (open (my $file, '/testfile')) { while (<$file>) { print if 1../^## START/ ; } close $file ; }
|
|---|