in reply to How to remove the $1 hard coding

sub a{ my($col,$string) = @_; ($string =~ /(.)(.)(.)(.)/)$col } a(2,"abcdefg")