[thelist] ASP: Load contents of a file into a variable

Dougal Campbell dougal at gunters.org
Tue Sep 21 14:16:20 CDT 2004

Casey Crookston wrote:
> Is there a simpler way of loading the contents of a .txt or .html file into
> a variable other than using FSO?

Install ActivePerl? :)

  <% @Language=PerlScript %>
  # reset record separator, so that we slurp the whole file
  undef $/;

  open(INPUT, $filename);

  # Read a file into a variable
  $foo = <INPUT>;

Ernest MacDougal Campbell III, MCP+I, MCSE <dougal at gunters.org>
http://dougal.gunters.org/             http://spam.gunters.org/
   Web Design & Development:  http://www.mentalcollective.com/
        This message is guaranteed to be 100% eror frea!

More information about the thelist mailing list