O'Reilly's Programming Web Graphics with Perl & GNU Software - Has anyone gotten this script to work? 
Author Message
 O'Reilly's Programming Web Graphics with Perl & GNU Software - Has anyone gotten this script to work?

In Chapter 10: Web Graphics Cookbook, I haven't been able to get the
counter.pl script to work. It seems to get stuck on or about the forth
unless function:

unless ($referer =~ /http:\/\/($users)(.*)/) {
    exit $error->black_box('You do not have privilages to access this
counter.');

Quote:
}

If I write it out word for word from the book it doesn't work (Perl doesn't
give any errors with -w and "use strict" is called, so it must be logic
errors). I've tryed all kinds of things including just commenting the
statement out all together but when I do that I get "Segmentation fault" and
the script doesn't run at all. Also, for some reason after I played with the
code a little, I get 3 other wierd error that makes no sense to me:
"Use of uninitiated value at ./counter.pl line 69, <COUNT> chunk 1."
"Use of uninitiated value at ./counter.pl line 73, <COUNT> chunk 1."
"Use of uninitiated value at ./counter.pl line 88, <COUNT> chunk 1."

What is a Segmentation fault? I can't find any refferance to what this is
anywhere.

Has anyone else tried running this script out of the book? Has anyone been
able to make it work?

If someone has an answer to any of these questions, please email me back if
you can help, since I am unable at this time to sort through 30,000
newsgroup posts to find an answer.

Thanks,
-Jeremy-

Please visit my homepage at http://www.*-*-*.com/ ~jeremy/



Fri, 09 Nov 2001 03:00:00 GMT  
 O'Reilly's Programming Web Graphics with Perl & GNU Software - Has anyone gotten this script to work?

Quote:
Jeremy Fowler writes:

 > In Chapter 10: Web Graphics Cookbook, I haven't been able to get the
 > counter.pl script to work. It seems to get stuck on or about the forth
 > unless function:
 >
 > unless ($referer =~ /http:\/\/($users)(.*)/) {
 >     exit $error->black_box('You do not have privilages to access this
 > counter.');
 > }

I'm not familiar with this book or application, but the following
pointers might help.

 > If I write it out word for word from the book it doesn't work (Perl doesn't
 > give any errors with -w and "use strict" is called, so it must be logic
 > errors).

What do you mean by "it doesn't work"?  Does it print an error
message?  Exit without doing what you want?  Hang?

 > "Use of uninitiated value at ./counter.pl line 69, <COUNT> chunk 1."
 > "Use of uninitiated value at ./counter.pl line 73, <COUNT> chunk 1."
 > "Use of uninitiated value at ./counter.pl line 88, <COUNT> chunk 1."

Look at the lines referred to.  The error is telling you that you are
looping on the file handle <COUNT>, and that the error described
happened the first time through this loop.  On each line, a variable
is being referred to taht has not yet been given an initial value.
You'll have to look through the code to the point where you think
you've given that variable a value, and think hard about whether it's
doing what you think it should.

 > What is a Segmentation fault? I can't find any refferance to what this is
 > anywhere.

A segmentation fault is a lower-level error.  It's not from Perl.
Generally, it means that memory has been improperly manipulated or
accessed.  Perl rarely generates seg faults in my experience, so I
would look closely at any third-party products you are using.

 > If someone has an answer to any of these questions, please email me back if
 > you can help, since I am unable at this time to sort through 30,000
 > newsgroup posts to find an answer.

Please post any responses to this message back to the list.  In
general, such a statement is not a good way to get into the good
graces of people who have sorted through 30,000 newsgroup posts to
find your question.

Good luck,

     David Saff
     TVisions



Sat, 10 Nov 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Programming Web Graphics with Perl and GNU Software

2. Programming Web Graphics with Perl and GNU Software

3. Demo programs from O'Reilly Book don't work

4. O'Reilly Open Source Software Convention in Monterey

5. O'Reilly University of Perl 2000 CGI$WWW Programming in Perl class prerequisites

6. O'Reilly: Advanced Perl Programming

7. New O'Reilly about Programming Perl DBI

8. GNU's getline functions & PERL

9. O'Reilly "passwd" program

10. the official word from Tim O'Reilly (of OR&A) about hardcover Camels

11. O'Reilly & Associates Nutshell Book Exhibit

12. O'Reilly CGI Programming book

 

 
Powered by phpBB® Forum Software