in reply to Inserting stuff into a filehandle.
I Think So. Easiest way i can think of is to have a TEMPFILE filehandle, and put the contents of "$stuff" and FILE to TEMPFILE, and then copy TEMPFILE to FILE.What might also work, but highly unlikely, is if you open a file handle for reading and writing,
I never tried this, and i'm not sure that $. can be set to a negative value.
$.
The current input line number for the last file handle from which you read (or performed a seek or tell on). An explicit close on a filehandle resets the line number. Because ``<>'' never does an explicit close, line numbers increase across ARGV files (but see examples under eof()). Localizing $. has the effect of also localizing Perl's notion of ``the last read filehandle''. (Mnemonic: many programs use ``.'' to mean the current line number.)
______________________________________________ |_____¸.·ooO--(> cRaZy is co01. <)--Ooo·.¸_____| ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Inserting stuff into a filehandle.
by Adam (Vicar) on Aug 09, 2000 at 21:44 UTC |