Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006

    Unanswered: ??need to tell script where perldoc is located??

    I just received my O'Reilly's Learning Perl book and my first script is not working. I have been learning Perl on my own for a month but this book is new to me. Anyway this simple script probably is not working because it is not locating the file:
    print "Content-type: text/html\n\n";
    use CGI qw(:standard -debug);
    use strict;
    my @lines;
    @lines = 'perldoc -u -f atan2';
    foreach (@lines) {
    I am running Perl on Windows XP Pro with IIS. OK, everything is installed right as I have been learning and running scripts for a few weeks. This 'perldoc -u -f atan2' is something by other book did not mention.

    I can run perldoc -u -f atan2 fine from the command prompt, but not from the above script. I am thinking that I have to tell the script where perldoc is located and I am not sure how to do that.

    Additional information that might be helpful:
    perldoc is located at: C:\Perl\bin
    The script is in: C:\Inetpub\wwwroot\cgi-bin\OReilly

    I am trying to access the script using this in the browser window: http://localhost/cgi-bin/OReilly/whirlwind.cgi and only prints perldoc -u -f atan2 out.
    Last edited by NevadaSam; 05-17-06 at 13:26.

  2. #2
    Join Date
    Feb 2006
    well, well, well, small world huh?

    You sure you looked at the book? The single-quotes ' should be back tiks `:

    @lines = `perldoc -u -f atan2`;

    Looking forward to seeing this question on 6 to 8 other perl forums.

  3. #3
    Join Date
    May 2006
    Thanks, KevinADC. That was the problem, and the text clearly said not to confuse the backquote with the single quote. I still may have a different book than most. It is the 4th Edition of Learning Perl. Only 15 more chapters to go.

    I did have to comment out the second line # print "Content-type: text/html\n\n"; before it would print with line breaks. Actually the book did not have that line in their code. It was something that I inserted when the script failed to work. I'm sure that I will understand that later.

    Thanks! Problem solved.
    Last edited by NevadaSam; 05-17-06 at 15:49.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts