That attempts to localise @opts, not the scalars referenced by the elements of @opts.
In reply to Re^2: Bug in YAML::Any - What to do? by ikegami in thread Bug in YAML::Any - What to do? by bv