sub getExtension($) { my($file) = @_; $file =~ m/.*\.(.*)$/; return $1; } sub exampleUse() { my($ext) = getExtension('myphoto.jpg'); print "ext=$ext\n"; }
Programming Tips - Perl: get the extension of a filename
Date: 2023mar10
Language: perl
Q. Perl: get the extension of a filename
A.