http://qs321.pair.com?node_id=853516


in reply to Simple line parse question

Yeah,you could do with split and join but it needs two functions.Instead, you can use the simple regular expression to achieve it.You check the following code.I have taken the space as a delimiter between each word in the string.

use strict; use warnings; my $string="one two three four five six"; $string=~/^(\w+ ){2}(\w+) (\w+)/; print $2$3; #it prints the words correctly as you expected