use constant { STRING=>0, NUMS=>1, }; sub foo{ $_[STRING] =~ tr[...][...] if $_[NUMS] == '123'; }