in reply to How to extract the substring from a delimiter (dot) to end of string?
Here's one way to do it, iterating backwards over the string as an array, then unshifting each char into another array until reaching the dot. Of course, you wouldn't normally want to do it this way in practice.
my @temp; for ( reverse @{[ split( '', $string ) ]} ) { last if /\./; unshift @temp, $_; } $extension = join '', @temp;
|
|---|