#! /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 $_ . $/; }
In reply to Re^2: get folder name only
by dmorelli
in thread get folder name only
by johnajb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |