in reply to Re^3: scalar ref losing it's value?
in thread scalar ref losing it's value?

The second snippet checks to make sure one, and only one row is returned. It dies if not.