Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
I want to be able to open it up, use a few lines, delete those lines and close it, so that when I come to use that file again I'm starting from the next unused line.
I could of course read the whole thing into an array, shift off the lines then write the remainder back, but there must be a more elegant way -- should I Tie this file in some way? Or have I missed something obvious?
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Shifting the top line(s) of a file?
by blue_cowdawg (Monsignor) on Jul 18, 2004 at 00:37 UTC | |
|
Re: Shifting the top line(s) of a file?
by beable (Friar) on Jul 17, 2004 at 23:35 UTC | |
|
Re: Shifting the top line(s) of a file?
by pg (Canon) on Jul 18, 2004 at 00:03 UTC | |
|
Re: Shifting the top line(s) of a file?
by Fletch (Bishop) on Jul 18, 2004 at 02:21 UTC | |
|
Re: Shifting the top line(s) of a file?
by thospel (Hermit) on Jul 18, 2004 at 13:13 UTC | |
|
Re: Shifting the top line(s) of a file?
by Anonymous Monk on Jul 22, 2004 at 04:13 UTC |