$_ = 'nothing can stop the bus on the road'; print +(split /stop/)[0], "\n"; print +(split /bus/)[0], "\n"; # output (with trailing space) nothing can nothing can stop the