in reply to Tie::File Deleting Lines Including "\n"
delete on a Tie::File array leaves the newline in order to behave as closly as possible to a real array. You want to use splice:
use Tie::File; my $file = "file.csv"; tie my @lines, Tie::File, $file or die "can't update $file: $!"; splice(@lines, 1, 1);
Update: I assumed you meant "first line pass the header" or something like that. If you truly want to delete the first line, you can use:
splice(@lines, 0, 1);
or
shift(@lines);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tie::File Deleting Lines Including "\n"
by awohld (Hermit) on Oct 04, 2005 at 20:50 UTC |