in reply to directory printing

This is not a Perl question, it is an HTML question.
print "$filename<br>\n";

Replies are listed 'Best First'.
Re^2: directory printing
by bart (Canon) on Dec 10, 2006 at 09:39 UTC
    You're hoping that the filenames don't contain special characters for HTML, thus "&" and "<". Granted, for filenames it's not very likely ("<" is even impossible on Windows), but it's a kind of laziness I personally don't appreciate.
      Fair comment.

      If I was doing his myself, I'd almost certainly be using File::Find and CGI, and I'd probably do something like:

      print ("$_",br,"\n") for @files;

      I suppose I could have suggested this to the OP...

      On Unix and Unix-like OSs any character except the path delimiter can be used in filenames, including characters that have special meaning in HTML (like [<>&]) and non-printing characters including CARRIAGE RETURN and NEWLINE. It's a good idea to HTML escape filesystem object names and, depending on the intended use, include some indication of the presence of non-printing characters where they occur.