swkronenfeld has asked for the wisdom of the Perl Monks concerning the following question:

There is some strange behavior on File::Spec->catfile on VMS (perl, v5.8.1 built for VMS_AXP)

Whenever my path length is a multiple of 8 + 1 (or a multiple of 8+3 if you count the brackets), e.g. 9, 17, 23, the path is formed incorrectly (as shown below). It discards the second argument and forms a file path based on the first argument only.
my $path = "[DIR."; my $tmp = ""; for(my $x=0; $x<60; $x++) { $tmp .= "a"; my $tmp2 = $path . $tmp . "]"; print File::Spec->catfile($tmp2, "file") . "\n"; } ----------------------------- $ perl USERS:[DIR.a]file USERS:[DIR.aa]file USERS:[]file USERS:[DIR.aaaa]file USERS:[DIR]aaaaa USERS:[DIR.aaaaaa]file USERS:[DIR.aaaaaaa]file USERS:[DIR.aaaaaaaa]file USERS:[DIR.aaaaaaaaa]file USERS:[DIR.aaaaaaaaaa]file USERS:[DIR.aaaaaaaaaaa]file USERS:[DIR.aaaaaaaaaaaa]file USERS:[DIR]aaaaaaaaaaaaa USERS:[DIR.aaaaaaaaaaaaaa]file USERS:[DIR.aaaaaaaaaaaaaaa]file USERS:[DIR.aaaaaaaaaaaaaaaa]file
I haven't been able to find anything through SuperSearch, google, cpan, etc related to this "bug". Does anyone have any idea what's going on? The next step will be to step through the Spec::File code, likely somewhere in the vmsify function or a child of it since this does not happen on UNIX.

Also, I have the latest version of File::Spec and File::Spec::VMS.

Any thoughts?