any option other than substr
Posted by kitwalker2886 (kitwalker2886), 11 May 2007if i want to cut and retrieve a string between any teo symbols.. do i ve any option other than using substr. cos i need to use index to calculate the posn if i wanna use substr..
Posted by admin (Graham Ellis), 11 May 2007Here's a possible solution:
earth-wind-and-fire:~/may07 grahamellis$ cat retwo
$string = "Look-between-hyphens";
($inbet) = $string =~ /-(.*)-/;
earth-wind-and-fire:~/may07 grahamellis$ perl retwo
This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho