print to top of file?
Hey- I was wondering how, once a file is open, to print something on the first line (moving everything originally in the document down), instead of on the last line? Thanks for any help!
------------------
Flame Hosting : http://www.flamehosting.com
NT and UNIX Hosting, Dedicated Servers, and Co-Location Programs
Justin Stayton - [email] [icq]
Orpheus posted this at 18:12 — 21st March 2000.
They have: 568 posts
Joined: Nov 1999
$array[0] will print the top line of the file if your reading it from an array.
If you wnt to move the rest of the file down you need to use the push() command.
Justin S posted this at 18:22 — 21st March 2000.
They have: 2,076 posts
Joined: Jun 1999
No, it's not going to be in an array. It will probably use the push() command. I looked up the push() command in Programming Perl, and it gave a really vague example:
Justin Stayton - [email] [icq]
Rob Pengelly posted this at 20:04 — 21st March 2000.
They have: 850 posts
Joined: Jul 1999
Somthing like this will work
http://www.thehungersite.com - http://www.therainforestsite.com
http://www.ratemymullet.com - Beauty is only mullet deep.
Justin S posted this at 20:15 — 21st March 2000.
They have: 2,076 posts
Joined: Jun 1999
Darn, the people who help in this forum are excellent. Thanks alot for both or your help. I'll try it out and see if it works.
------------------
Flame Hosting : http://www.flamehosting.com
NT and UNIX Hosting, Dedicated Servers, and Co-Location Programs
Justin Stayton - [email] [icq]
Orpheus posted this at 21:39 — 21st March 2000.
They have: 568 posts
Joined: Nov 1999
Sorry I didn't get back to you sooner with that, I was at school when I posted.
***Senior Member?***
japhy posted this at 14:33 — 23rd March 2000.
They have: 161 posts
Joined: Dec 1999
Writing to the beginning of a file is extremely inefficient. You end up the following, and you probably forget to flock() the file.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.