use strict; use warnings; use File::Spec::Functions; use Win32 qw(CSIDL_DESKTOP); my $directory = Win32::GetFolderPath(CSIDL_DESKTOP); my $file = "my log file.log"; my $path = catfile($directory,$file); open my $input, '<', $path or die "Can't open INPUT: $!"; my @lines = <$input>; print "I have access to the folder\n"; close $input;