in reply to Error with GetDRIVE() when using a mapped drive

Welcome to the monastery!,

For whatever reason GetDrive is failing on your Y: drive. This means $d is left uninitialized and causes errors when you try to dereference it in the following lines. Change that GetDrive line to this:

my $d = $fs->GetDrive('Y:') or die "GetDrive failed $!";
It doesn't answer what the problem is with drive Y: on your machine.. (does it exist for sure?) but it explains what's happening in your script.