Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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 =~ /([^:]+)$/ In reply to Re: how to split a string and take certain position?
by mreece
|
|