
mmcw
User
May 22, 2000, 2:55 AM
Post #1 of 2
(252 views)
|
|
find::file module
|
Can't Post
|
|
Hello, I use this module to find the sub dirs and files in the sub dirs. use File::Find; find( sub{push @files,$File::Find::name if -f; unshift @dirs,$File::Find::name if -d}, $BackupSystem ); This will result in @dirs with contains all the sub directories and @files with contains all the files in the dir and sub dir. The result is a complete path: something like this: foreach (@file) { print "$_", } result will be: /data1/hypermart.net/mmcw/cgi-bin/DCShop/Backup/System/Div/vatcode.txt Is it possible to use the File::Find module so that the result will not be the complete path but oonly the part without the mainpart: $BackupSystem. $BackupSystem: "/data1/hypermart.net/mmcw/cgi-bin/DCShop/Backup/System/"; foreach (@file) { print "$_", } result will be: Div/vatcode.txt
|