in reply to How to extract the substring from a delimiter (dot) to end of string?
In the spirit of TIMTOWTDI, you could also do:
( $extension ) = $string =~ /([^.]*)$/;
The above will give you the whole string if it does not contain any dots. If you want the result to be undef if there are no dots, you could use:
( $extension ) = $string =~ /\.([^.]*)$/;
|
|---|