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


in reply to how to split a string and take certain position?

sure, if you group your parens appropriately -- (split)[$i]:

  print( (split(/:/, $sentence))[1] );  # negative indexes work too

or the less cluttered: print +(split /:/, $sentence)[1];

for the latter question, consider: ($match) = $sentence =~ /([^:]+)$/