in reply to Re: get folder name only
in thread get folder name only
#! /usr/bin/perl -w use strict; use File::Basename; # Test data my @dirs = ( 'c:/mail/test2', 'c:/mail', 'c:/mail/test2/', 'c:/mail/', ); foreach (@dirs) { print "before: $_ "; # Strip off the trailing / # Warning: may not be platform independent s|/$||; print "after: " . basename $_ . $/; }
|
|---|