Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Say you are reading in some date line by line, is it possible to do an if command that that looks if it's the last line?
if ($data = Last line){ print "This is the last line\n"; }
And a similar if it's a blankline (containing 0 characters). But I feel that's more easy.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Detecting last line and blank line
by davido (Cardinal) on Nov 07, 2017 at 01:04 UTC | |
by haukex (Archbishop) on Nov 07, 2017 at 05:27 UTC | |
|
Re: Detecting last line and blank line
by 1nickt (Canon) on Nov 07, 2017 at 00:40 UTC | |
by Anonymous Monk on Nov 07, 2017 at 01:07 UTC | |
|
Re: Detecting last line and blank line
by LanX (Saint) on Nov 07, 2017 at 01:14 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |