• 0

Total n00b Perl questions


Question

I just started reading about Perl a few days ago. I wrote my first cgi script but it doesn't even compile

#!/usr/bin/perl -w
use CGI qw(:standard);

my $host = param("host");
my $visitor = param("visitor");
my $time = param("time");
open(LOGFILE, ">log");
print LOGFILE ("$host, $visitor, $time");
close(LOGFILE);

The error I get is:

Use of uninitialized value in concatenation (.) or string at cgi line 8.

Can someone tell me what's wrong?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

>>print LOGFILE ("$host, $visitor, $time");

I don't think you have to put the "$" in those variables here. That might be the problem, i tested it and it worked.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.