in reply to Text File Problem

The first obvious problem you have is that this...

my $template_data = "/cgi-bin\\content\\unsecure\\".$filename;

has absolutely no chance of being a valid path on any system I know of. As a result your open will fail and as you appear not to have printed a header? you are probably getting a 500 internal server error. "Does not work" is self evident....I suggest you read CGI Help Guide and add in some debugging code and report the error message if you want some more useful help.

Something like this might be a good starting point:

#!/usr/bin/perl -w # ensure all fatals go to browser during debugging and set-up # comment this BEGIN block out on production code for security BEGIN { $|=1; print "Content-type: text/html\n\n"; use CGI::Carp('fatalsToBrowser'); } use CGI ':standard'; my $find = param("name"); my $filename = "template_data_test.txt"; my $fullpath = "/full/path/to/cgi-bin/content/unsecure/" . $filename +; open IN, $fullpath or die_nice("Can't open $fullpath, perl says $!\n") +; my $found_it = 0; while (<IN>) { /^([^*])\*/; if ( $find eq $1 ) { $found_it = 1; last; } } close IN; if ($found_it) { # do found it stuff print "Found it!\n"; } else { # do didn't find it stuff print "Did not find it!\n"; } sub die_nice { print "Content-type: text/html\n\n"; print "Error " . shift; require Cwd; print "By the way the current working directory is " . Cwd::getcwd +(); print "\nYou can use this to get your path right!"; exit; }

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print