Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: making sure a file is not currently being written to

by why_bird (Pilgrim)
on Jun 05, 2008 at 14:21 UTC ( #690443=note: print w/replies, xml ) Need Help??


in reply to Re: making sure a file is not currently being written to
in thread making sure a file is not currently being written to

Only if you use lexical variables as file handles. If you use open HANDLE, '>', $file;, then HANDLE is a global that doesn't go out of scope.

Ah, I didn't realise this, thank you (I'm not yet quite on top of typeglobs(?)). In reality there are a lot of different subs writing to that file---I thought I had checked them all for terminating close()s, but perhaps I've missed one... What I'm doing should be fairly simple, so I doubt I've found a long hidden bug.. much more likely to be a mistake on my part. I'll check it out :)

thanks

........
Those are my principles. If you don't like them I have others.
-- Groucho Marx
.......
  • Comment on Re^2: making sure a file is not currently being written to

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2021-10-23 23:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (88 votes). Check out past polls.

    Notices?