I'm currently doing the following
Reading the entire contents of the file into memory is time consuming and inefficient.#!/usr/bin/perl use warnings; use strict; open (FOO, "test") || die "ERROR Unable to open test: $!\n"; my @array = <FOO>; close FOO; my $first = shift (@array); my $last = pop (@array);
Any suggestions?
In reply to Capturing the first and last line of a file ? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |