in reply to Please explain the '$x ||' idiom

$x is set to $x, unless $x is false, in which case it's set to 5. Same as $x ||= 5. Check perlop for more info.