in reply to subroutine()[$x];

Perl doesn't know if you want to take a function then slice the result, or take a slice and pass that to the function. So you have to clarify as follows:
my $var = "1:2:3:4:5:6"; my $x = (split":",$var)[4];