in reply to one liner question
I'll put in my two cents worth. Use Tie::File to get an array and then reverse it before traversing it.
use warnings; use strict; use Tie::File; tie my @filearray, 'Tie::File', 'backwards.log' or die "couldn't tie f +ile $!\n"; foreach (reverse @filearray) { if (/received/) { printf "%s %s\n", (split)[0,1]; last; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: one liner question
by haukex (Archbishop) on Apr 21, 2017 at 15:01 UTC |