in reply to Error of the argument

I wouldn't mix dos path separators with unix ones:

$files_location = "c:/files/err";
And I would use the three arguments version of open:
open( DLFILE, "<", $files_location . "/" . $ID ) ...
If that still causes problems, I would probably use File::Spec to create the pathname (all that back slashing for Win32 drives me nuts).

-derby

Replies are listed 'Best First'.
Re^2: Error of the argument
by almut (Canon) on Dec 27, 2007 at 20:35 UTC
    I wouldn't mix dos path separators with unix ones

    ...not only that, the specification "c:\files\err" is wrong by itself, because backslashes are special within double quotes (e.g. \f represents a form feed, and \e the escape char).

    Including the filename in the error message often is a good idea. For instance,

    my $filename = "$files_location/$ID"; open(DLFILE, "<", $filename) || Error('open', "file '$filename'");

    In that case, the OP would have gotten something like

    The server can't open the file 'c:ilesrr/...': Invalid argument 
    

    which might have hinted at the fact that there's something wrong with the filename...