Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Automatically exiting a file within a block

by ikegami (Patriarch)
on Jun 26, 2019 at 08:22 UTC ( [id://11101917]=note: print w/replies, xml ) Need Help??


in reply to Re: Automatically exiting a file within a block
in thread Automatically exiting a file within a block

I don't know if that's the case of Python, but C# uses a structure like the OP presented because it ensures timely destruction of the object.

This isn't needed in Perl because Perl's garbage collector ensures that objects are destroyed as soon as they are no longer referenced. (Well, before the start of the next statement after the one in which they cease being referenced, anyway.)

While this leads to simpler code in Perl, the C# (and maybe Python) approach is faster and can handle references cycles.

  • Comment on Re^2: Automatically exiting a file within a block

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 23:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found