use strict; use warnings; use Win32; die unless $^O =~ /Win32/i; my $copyme = 'C:/Apache/www-root/images'; my $here = 'C:/Apache/www-root/images/bgs'; $copyme = Win32::GetFullPathName($copyme); $here = Win32::GetFullPathName($here); # index STR, SUBSTR if( (index($copyme,$here) != -1) or (index($here,$copyme) != -1) ) { die "a horrible death"; } # Win32::GetShortPathName and Win32::GetLongPathName # may also be of interest (for use with open)