Well, I did try the following test before putting "%$search%" into the snippet suggestion in my own reply:
perl -Mstrict -le 'my $s="blah"; print "%$s%"'
which prints "%blah%". Putting a "%" in front of a scalar variable in a double-quoted string will not turn that variable into a hash ref.
If the variable happens to already be a hash ref, then of course it will be interpolated as such, though not in a way that most folks would consider useful:
perl -Mstrict -le 'my $s={foo=>"bar"}; print "%$s%"'
prints something like "%HASH(0x1801380)%". It's only arrays (and array refs) that get interpolated into the list of values when placed inside double-quotes -- and only if the sigils are right:
perl -Mstrict -le 'my %s=(foo => "bar"); print "%s"'
%s
perl -Mstrict -le 'my $s=[qw/foo bar/]; print "%$s%"'
%ARRAY(0x1801380)%
perl -Mstrict -le 'my $s=[qw/foo bar/]; print "@$s@"'
foo bar@
|