From owner-freebsd-questions Thu Oct 18 23:18:45 2001 Delivered-To: freebsd-questions@freebsd.org Received: from kabel203069.kabel.utwente.nl (kabel203069.kabel.utwente.nl [130.89.203.69]) by hub.freebsd.org (Postfix) with ESMTP id DCAF237B405 for ; Thu, 18 Oct 2001 23:18:40 -0700 (PDT) Received: by kabel203069.kabel.utwente.nl (Postfix, from userid 1000) id 1E2C013677; Fri, 19 Oct 2001 08:18:39 +0200 (CEST) Date: Fri, 19 Oct 2001 08:18:38 +0200 From: Rogier Steehouder To: Andre` Niel Cameron Cc: free bsd Subject: Re: Perl Help Please Message-ID: <20011019081838.A616@localhost> Mail-Followup-To: Rogier Steehouder , Andre` Niel Cameron , free bsd References: <077d01c15838$2a6af4f0$a50410ac@olmct.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <077d01c15838$2a6af4f0$a50410ac@olmct.net>; from AndreC@Axxs.net on Thu, Oct 18, 2001 at 08:51:19PM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 18-10-2001 20:51 (-0400), Andre` Niel Cameron wrote: > #!/bin/perl > print "Content-type: text/html\n\n"; > @COMMAND= ("Login", "Fight"); Okay so far. > &Display_Html("templates/login.html"); > > $check= $ENV{QUERY_STRING}; > > if ($check == $COMMAND[0]) { > &Display_Html("templates/test.html"); > } I'd make this: if ($ENV{'QUERY_STRING'} eq $COMMAND[0]) { &Display_Html("templates/test.html"); } else { &Display_Html("templates/login.html"); } What you're doing is send the login page to the client and then, if the test succeeds, add the test page to that page. Remember, everything you send to stdout will be send to the web browser. > sub Display_Html { > $data_file = $_[0]; > open(HTML, $data_file) || die("Could not open file!"); > @Html_template=; > close(HTML); > print "@Html_template"; > @Html_template= (); > } Remove @Html_template. It's eating memory. while () { print; } Or slightly more readable: while ($line = ) { print($line); } With kind regards, Rogier Steehouder -- ___ _ -O_\ // | / Rogier Steehouder //\ / \ r.j.s@gmx.net // \ <---------------------- 25m ----------------------> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message