in reply to Replace first blank line in a text file with headers.
use strict; use warnings; use Tie::File; my $filename = 'dir/people.txt'; tie my @array, 'Tie::File', $filename or die "Could not open file '$fi +lename' $!"; $array[0] = 'Name, City, State, Zip' unless $array[0] =~ /\S/; untie @array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Replace first blank line in a text file with headers.
by Anonymous Monk on Mar 24, 2016 at 15:33 UTC | |
|
Re^2: Replace first blank line in a text file with headers.
by Anonymous Monk on Mar 24, 2016 at 18:34 UTC | |
|
Re^2: Replace first blank line in a text file with headers.
by Anonymous Monk on Mar 24, 2016 at 23:13 UTC |