I want to right truncate a value of attribute to string of length 40 using regex in Perl.
I tried to do it without using regex, only substr()
but it’s not working.
$attribute = substr ($attribute , -1 ,40);
"Right truncate" equals to using substr()
the usual way:
$attribute = substr($attribute,0,40)