in reply to Weird ?: behavior

This happens, I believe (I can't find the FAQ on this) when you are doing variable assignments. I would write that line more like:
my $xm = $hour > 11 ? "pm" : "am";

Cheers,
KM