in reply to directory unicode

Within <c>...</c> and <code>...</code> tags, Unicode characters (outside the ASCII range) are displayed as character references (e.g. &#322;). In these cases, it's better to use <pre>...</pre> blocks (or <tt>...</tt> for inclusion within a sentence). The code you posted looks like '$dir="Ma&#322;retuzz";' but it should look like '$dir="Małretuzz";': we have no way of knowing which of those forms you typed either in your posting or in your original code. [Side issue: while it probably doesn't matter in this instance, given that you're not intending any interpolation of Małretuzz, single quotes would be more appropriate.]

This line of code looks highly dodgy (although B::Deparse reports no syntax errors1):

print our $short_path_dir = Win32::GetShortPathName( "$dir" );

Something like this would probably have been better:

my $short_path_dir = Win32::GetShortPathName($dir); print $short_path_dir;

The actual error returned would have been better than a prosaic description of it (i.e. "This gives me a not initialized value."). Win32::GetShortPathName(PATHNAME) says "Returns undef when the PATHNAME does not exist.", so that seems to be a likely candidate: the cause may be related to how you typed Małretuzz or you may be just running your script in a directory that does not have a Małretuzz subdirectory. Furthermore, using warnings and strict will alert you to other potential issues in your code.

[1] "... B::Deparse reports no syntax errors"

$ perl -MO=Deparse,p -e 'print our $short_path_dir = Win32::GetShortPa +thName( "$dir" );' print our $short_path_dir = Win32::GetShortPathName("$dir"); -e syntax OK

-- Ken