Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Reopen file when contents changed?

by chb (Deacon)
on Jun 08, 2005 at 10:22 UTC ( #464623=note: print w/replies, xml ) Need Help??


in reply to Re: Reopen file when contents changed?
in thread Reopen file when contents changed?

Huh? Pointer? static? What are you talking about?
  • Comment on Re^2: Reopen file when contents changed?

Replies are listed 'Best First'.
Re^3: Reopen file when contents changed?
by Thargor (Scribe) on Jun 08, 2005 at 16:30 UTC
    When you open a file you have a pointer that points at the first line of the file. So I was just suggesting the OP might want to try just dupelicating that pointer and not changing what it points to while the original file pointer loops through the rest of the lines of the file reading in the data. I am slightly new to perl not sure if it would work. Hence it would be a static pointer, one that does not change, which is all the OP needs a constant pointer to the first line of the file. This would only be usefull if he isn't adding any information to the top of the file because the pointer would then not be pointing to the correct line.
      I think there was a misunderstanding. The combination of the words 'pointer' and 'static' made me think of a c-style static pointer, a thing that simply does not exist in perl. You are right, you would need something that addresses the beginning of the file. But that would be a fileposition, which is always 0 for the beginning of a file (kind of static...), so there is no need to store anything.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://464623]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2022-08-18 04:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?