In Perl, how can I read an entire file into a string?
问题 I\'m trying to open an .html file as one big long string. This is what I\'ve got: open(FILE, \'index.html\') or die \"Can\'t read file \'filename\' [$!]\\n\"; $document = <FILE>; close (FILE); print $document; which results in: <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN However, I want the result to look like: <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"> <html> <head> <meta http-equiv=\"Content-Type\" content=\