in reply to getting file size and date

I'm not exactly sure what you're doing with these lines:
$file =~ s/$dir\///g; $dir =~ s/\//\\/g;
If you could talk those through in English, I might be able to help.

However, if your intent is to get just the basename, be aware that $_ already has that. Simplifying your code, I'd just go with this:

find sub { return unless -f; my $size = -s; print "file: $_\n", "dir: $File::Find::dir\n", "size: $size\n"; }, $rootdir;

-- Randal L. Schwartz, Perl hacker