in reply to WinNT Opendir with CGI
In that case, chomp will remove the \n, but there will still be a trailing \r at the end of the filename.
Your error message ought to print "Cannot open $directory" and then the contents of $!. Since you're only getting $!, if you've reported the entire error message, it indicates that Perl printed the first part of the error, hit the \r, moved back to the first column, and printed the second half:
The simple fix is to strip out any carriage returns with a transliteration: $directory =~ tr/\r//d;my ($one, $two) = qw( one two ); print "$one\r$two\n";
As a side note, I usually debug variables by printing them like print "Directory: ($directory)\n";. That helps make whitespace apparent.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: WinNT Opendir with CGI
by strredwolf (Chaplain) on Feb 04, 2001 at 11:00 UTC |