pricecharts

track prices of consumer electronics
Log | Files | Refs | README

commit 89a57e8d96147787fa53dacf77f50bf11b136f86
parent 36cdf86bbdce663aa44006d3fe7558c96a58d8c4
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Sun,  9 Nov 2014 19:48:20 -0700

search: add comments, don't quote bare variable

Diffstat:
Msearch.pl | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/search.pl b/search.pl @@ -17,6 +17,7 @@ if (-e $pid_file) { exit; } +# third field is uid my @struct_passwd = getpwnam("www"); my $daemon = Proc::Daemon->new( setuid => $struct_passwd[2], @@ -29,6 +30,8 @@ $daemon->Init(); # shut down cleanly on kill $SIG{TERM} = \&sig_handler; +# stdout/err doesn't get flushed to the log file otherwise +$| = 1; my $socket_path = "/var/www/run/search.sock"; my $socket = FCGI::OpenSocket($socket_path, 1024); @@ -65,7 +68,7 @@ while ($request->Accept() >= 0) { my $products = $search_sth->fetchall_arrayref(); my $vars = { - query => "$input", + query => $input, num_results => scalar @$products, results => $products };