Try setting 'Blocking => 0' in your config for Asterisk::AMI.
By default the constructor will block when trying to connect/login to asterisk. Setting it 'Blocking => 0' tells it to use a non-blocking connect.
Also your DoneAsterisk sub will fail because as soon as Asterisk::AMI goes out of scope it will automatically be destroyed and disconnect from asterisk.