I was also confused about what this
$$blk_ref was about. And I just punted that issue in my direct post. It would be helpful if the OP showed more of his application. Dereferencing a ref to a single scalar is a relatively rare thing in Perl. That is because Perl array iterator operations are very good at hiding this nastiness.
For fun, I used your example data and coded the loop a couple of different ways. Neither of which use an explicit dereferencing operation.
use strict;
use warnings;
use Data::Dump qw(dd);
my @strings = (
'SMS,SMS1,20190811',
'SMS,SMSh,20190811',
'SMS,SMSH,20190811',
'SMS,SMSx,20190811',
'SMS,SMSi,20190811',
'SMS,SMSX,20190811',
'SMS,SMSI,20190811',
);
# map{} is a logical thought for an array transformation
#
# Could assign back to @strings or can make
# a new array, @strings2
# Could use an "if" and concatenate a message if true
# and return $_ in any event. Ternary operator here
# gives a place to put a single token that is
# not "SMSblk"
my @strings2 = map{/SMS[1HI]/i ? "$_ is SMSblk":$_}@strings;
dd \@strings2;
=prints:
[
"SMS,SMS1,20190811 is SMSblk",
"SMS,SMSh,20190811 is SMSblk",
"SMS,SMSH,20190811 is SMSblk",
"SMS,SMSx,20190811",
"SMS,SMSi,20190811 is SMSblk",
"SMS,SMSX,20190811",
"SMS,SMSI,20190811 is SMSblk",
]
=cut
# Or with a for loop instead of map{}
# to modify original array:
# Foreach creates an alias and modifying that
# alias modifies the original array
# No tricky dereferencing is needed.
foreach (@strings)
{
$_ .= " is SMSblk" if /SMS[1HI]/i;
}
dd \@strings;
=prints:
[
"SMS,SMS1,20190811 is SMSblk",
"SMS,SMSh,20190811 is SMSblk",
"SMS,SMSH,20190811 is SMSblk",
"SMS,SMSx,20190811",
"SMS,SMSi,20190811 is SMSblk",
"SMS,SMSX,20190811",
"SMS,SMSI,20190811 is SMSblk",
]
=cut