Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

•Re: On timely destruction?

by merlyn (Sage)
on Aug 28, 2002 at 00:27 UTC ( #193319=note: print w/replies, xml ) Need Help??


in reply to On timely destruction?

{ my $foo; open $foo, "<bar.txt"; print "Baz\n"; } { my $foo; open $foo, "<bar.txt"; print "xyzzy\n"; }
That's not an issue, because any new use of open should do a clean close, as if the variable has also gone out of scope.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: •Re: On timely destruction?
by Elian (Parson) on Aug 28, 2002 at 00:50 UTC
    Well... not in the case I posited. Since the filehandle variables were lexically scoped, the second open is using a different lexical than the first open, so no force-close there.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://193319]
help
Chatterbox?
[M4ver1k]: I feel like being able to toggle a running script on the fly by updating variables from a config file using Config::Simple. But in the while loop, it seems like it doesn't update the variable after the first past. Is this generally just a bad idea?
[M4ver1k]: pass*

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2017-11-20 03:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (283 votes). Check out past polls.

    Notices?