Home
TeamSite
TeamSite, LiveSite and OpenDeploy
Perl get suffix ?
Andy Knipp
i have am trying to get the suffix from a directory (.html).
I tried using fileparse but it is not consistant without a suffix list:
#!/iw-home/iw-perl/bin/iwperl
use File::Basename;
$src="/tmp/test/AA3.FINAL.TXT";
($base, $dir, $suffix) = fileparse($src);
print "Base $base dir $dir suffix $suffix\n";
yields:
Base AA3.FINAL.TXT dir /tmp/test/ suffix
Is there a trick to getting this to work or shoudl I just look for the last period ?
Andy
Find more posts tagged with
Comments
There are no comments yet