How do I test a SV is readonly?

use B;
!!(B::svref_2object(\$_[2])->FLAGS & B::SVf_READONLY);

Published: 2013-04-12(Fri) 01:31