Is there any way to influence the order destructors are called when Perl shuts down (because of a signal or exit)? And if not, any ideas for how to handle this situation better?
Here's what I've got going on. I'm operating a device via the serial port. My object (RFID::Matrics::Reader) is sending a command to the device telling it "Hey, collect data as fast as you can and send it to me!" When the object is destroyed (usually by program exit on SIGINT), I'd like to send a command down the serial line that says "OK, thanks, you can stop now." But the COM port object is being destroyed before the Reader object, so I can't access the serial device object to send commands.
Thanks for any ideas!
In reply to Destructor Order by sgifford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |