#! usr/bin/perl my ($occ,$str); $str="hi there this is perl monks forum."; print "enter number of occurence where you want to split\n"; $occ=; chomp($occ); $str=~ /(\S+\s){$occ}/; print "left : $& \nRight: $'\n";