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