in reply to Re: use variable as name for new file
in thread use variable as name for new file

THis is the error Im getting

createfile.cgi did not produce a valid header (name without value: got line "syntax error at createfile.cgi line 27, near "$subject")
  • Comment on Re^2: use variable as name for new file

Replies are listed 'Best First'.
Re^3: use variable as name for new file
by samizdat (Vicar) on Jun 16, 2006 at 14:57 UTC
    I see that you've posted more, thanks. It's not the file write at all. You should create a CGI query object and use the OO interface. If you use the functional interface there's another step to it, before you can read parameters. Forgotten what it is at the moment, sorry.
    my $q = new CGI; my $subject = $q->param('subject');
    Is the page this is run from _sending_ the parameters??? This might be your real problem. Is your <form> set up properly?

    Don Wilde
    "There's more than one level to any answer."
      You should create a CGI query object and use the OO interface.

      Why? The functional interface works fine here. What advantages do you think the OO interface has?

      If you use the functional interface there's another step to it, before you can read parameters. Forgotten what it is at the moment, sorry.

      To use the functional interface you need to import the required functions into your program's namespace. One way to do that is with the

      use CGI ':standard';

      line that this program already has. So it seems that the functional/OO difference is a complete red herring here.

      --
      <http://dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg

        <sackcloth and ashes> I misread the man CGI page.

        Don Wilde
        "There's more than one level to any answer."