Wiggins d Anconia wrote:

Gunnar Hjalmarsson wrote:



Werner Otto wrote:



Gunnar Hjalmarsson wrote:



Add this line at the top of the script:

use CGI::Carp 'fatalsToBrowser';


The permissions on running.pdf was not correct. It helps if you
know how to debug!


Talking about debugging... You should get the habit of including:

   use strict;
   use warnings;

in the beginning of every Perl program you write. (They would not have
made a difference to solve this particular problem, but they may do so
next time.)



Yes, I tend not to do that.... Makes my code look beter when it runs......... Just fooling myself I guess.




You are, and beauty is in the eye of the beholder, your code may look better to you, but to the computer it definitely doesn't. Perfect example, given,

open(test123, ">>/home/staff/wot/public_html/perl/test.csv") or die
("File test.csv could not be opened for writing");

What do you think the following three lines do?

flock(test, 2);
seek(test, 0, 2);

close(test);

Or how about your error conditions,

or die "Error adding $file_gif: $!\n";
or die "Error adding $file_zip: $!\n";

So much for including the filename.

'strict' and 'warnings' will save you hours of headache.

http://danconia.org



When I include warnings and strict is give me allot of warnings. What do they mean?

<h1>Software error:</h1>
<pre>Global symbol &quot;$surname&quot; requires explicit package name at ola.cgi line 15.
Global symbol &quot;$name&quot; requires explicit package name at ola.cgi line 16.
Global symbol &quot;$email&quot; requires explicit package name at ola.cgi line 17.
Global symbol &quot;$surname&quot; requires explicit package name at ola.cgi line 20.
Global symbol &quot;$name&quot; requires explicit package name at ola.cgi line 21.
Global symbol &quot;$email&quot; requires explicit package name at ola.cgi line 22.
Global symbol &quot;$surname&quot; requires explicit package name at ola.cgi line 27.
Global symbol &quot;$name&quot; requires explicit package name at ola.cgi line 27.
Global symbol &quot;$email&quot; requires explicit package name at ola.cgi line 27.
Global symbol &quot;$msg&quot; requires explicit package name at ola.cgi line 63.
Global symbol &quot;$msg&quot; requires explicit package name at ola.cgi line 70.
Global symbol &quot;$msg&quot; requires explicit package name at ola.cgi line 75.
Global symbol &quot;$file_gif&quot; requires explicit package name at ola.cgi line 80.
Global symbol &quot;$msg&quot; requires explicit package name at ola.cgi line 82.
Global symbol &quot;$file_zip&quot; requires explicit package name at ola.cgi line 87.
Global symbol &quot;$msg&quot; requires explicit package name at ola.cgi line 90.
ola.cgi had compilation errors.
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.


</p>
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$surname" requires explicit package name at ola.cgi line 15.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$name" requires explicit package name at ola.cgi line 16.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$email" requires explicit package name at ola.cgi line 17.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$surname" requires explicit package name at ola.cgi line 20.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$name" requires explicit package name at ola.cgi line 21.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$email" requires explicit package name at ola.cgi line 22.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$surname" requires explicit package name at ola.cgi line 27.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$name" requires explicit package name at ola.cgi line 27.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$email" requires explicit package name at ola.cgi line 27.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$msg" requires explicit package name at ola.cgi line 63.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$msg" requires explicit package name at ola.cgi line 70.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$msg" requires explicit package name at ola.cgi line 75.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$file_gif" requires explicit package name at ola.cgi line 80.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$msg" requires explicit package name at ola.cgi line 82.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$file_zip" requires explicit package name at ola.cgi line 87.
[Thu Jul 8 15:05:23 2004] ola.cgi: Global symbol "$msg" requires explicit package name at ola.cgi line 90.
[Thu Jul 8 15:05:23 2004] ola.cgi: ola.cgi had compilation errors.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to