in reply to Detect standby/hibernation mode
Check the documentation of hibernate and acpi, it's much easier than trying to monitor such things from within perl.