#!/usr/bin/perl use strict; use warnings; use Tie::File; my $file = "file.txt"; my @lines; tie @lines, 'Tie::File', $file or die $!; print $_,"\n" for (@lines[0 .. $#lines-2]); untie @lines;
In reply to Re: Print all lines in a file except the last two
by neniro
in thread Print all lines in a file except the last two
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |