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

•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

Comment on •Re: On timely destruction?
Download Code
Replies are listed 'Best First'.
Re: &bull;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?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2015-11-26 09:26 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls