The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
When a file is read into an array the last element in the array array-1 would give you what you are looking for. To put it more clearly, and in actual Perl rather than some pseudo-language, the first example above, i.e.
could be rewritten like
or even without creating an intermediate @array:
Incidentally, I put a my in front of that as a reminder of the good rule of always staying strict. In reply to Re^2: Answer: How do I copy out the last line written in a file?
by blazar
|
|