in reply to Creating a script

Warning: not a Perl solution ahead.

It looks like you're trying to duplicate what rsync and Unison (among others) do. Of course they run on both Win32 and UNIX platforms and can save you lots of time and pain.

-- TMTOWTDI