prints ".test.txt". So I don't think I'd recommend that one...sub fileExtension { my $file = shift; my $pos = index($file,"."); if ($pos == "0") { return undef; } else { my $ext = lc(substr($file,$pos)); return $ext; } } my $filename = 'test.test.txt'; print fileExtension($filename);
($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print
In reply to Re: Rewrite a PHP fileExtension function
by Cody Pendant
in thread Rewrite a PHP fileExtension function
by ghenry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |