use strict; use warnings; my $col = 3; my $str = "one two three four five"; my $output = (split /\s+/, $str)[$col]; print "output=$output\n"; __END__ output=four